Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Search/Filter On Long Data Type In Oracle 7.3


Hello,
Can anyone tell me if its possible to search or filter on a long data type using VB and ADO. My database is Oracle7.3 and due to certain limitations its not possible for me to upgrade my database to a higher version of Oracle.
Thanks in advance




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Convert Long Data Type To Integer Data Type
I am trying to convert an array from a long data type to an integer data type. When I use the Cint() function I am getting an overflow error. Is there a way around this? Basically what I am trying to do is to convert two successive 16 bit representations (stored as a long) number into a floating point using the MoveMemory API. The .ReadResults is an OCX defined function that reads MyLongData(j) from Memory and stores into a long data type.


Code:
Dim MyIntData(2) As Integer
Dim MyLongData(2) As Long

Dim fValue As Single
Dim j As Integer

For j = 0 To 1

MyStatus = MbMasterV71.ReadResults(hConnect, Slave, Cmd, RegStart + j, MyLongData(j))

Next j

MyIntData(0) = CInt(MyLongData(0))

CopyMemory fValue, MyIntData(0), 4

Actual Size Of The Data In A LONG RAW (oracle Blob) Field
Hi,

I'm going crazy. I want to find out the actual size of the data which is stored in a long raw oracle field. I know how to read and write data to a long-raw field with the Get- and Append-Chunk methods. this works fine as long as you the file length stored separately in another field in this table to input it to the getchunk method. but i dont want to have to input the size - i mean the data is already saved in the long-raw field so why should i additionally supply it from outside.

the property ActualSize for example delivers a wrong value. Theres also a property called DefinedSize which is the max size of the long-raw. But how to get the data size?

Can yomebody help me?

Long Data Type && Factor
Hi,
I world like help on 2 things in VB6 Please.

First. I understand the Long data type has a number range between approx -2 billion and +2 billion. Is there any other data type I can use to get a bigger number. For example, I would like to work out combinations with in varibles. To do this I need to Factor, (I think that is the correct name, and this is related to my second question) 49 * 48 * 47 * 46 * 45 * 44, the result from this calculation is bigger than 2 Billion. I think the Long data type is 16 bit, what I am looking for, I think, is a 32 bit data type. If there isn't a 32 bit data type, baybe there is a command or function that can multiply fractions, eg. 49 over 6 * 48 over 5 etc. This calulation here is obviusly the fornule to work out how many combinations there are to win the National Lottery Jackpot.

Second, as mentioned above, Factor. I am sure there is a VB6 Function that will Factor numbers, example, Function(6) would give a result of 720 that is 6 * 5 * 4 * 3 * 2 * 1. Does anybody know this function.

Thank you in advance,
DjJazzy.

Long Number Data Type
Hey all (again, sorry for all the questions ^^;; )

I'm just wondering if there's a data type or if one can be made for storing very long numbers, but being able to perform mathmatical calculations on them? (i.e. not a string).

I want to use the Rnd function to generate a 20-digit number, e.g. 40229603967719402863. I can't store it int/long/etc as it's too long, I can store it in Double but then it makes it a floating point number.

Soo.. Any way to generate a number of this size and have it display the full value? I'm trying to generate a unique ID, you see

Retrieving Long Data Type
Folks,

I am trying to retrieve data from a table/column where the datatype is LONG. Database is Oracle. For some reason, I am unable to retrieve the entire content of the column. The amount of data to be retrieved is very small ... 500-800 bytes but for some reason, the records get truncated to 256 bytes. I have found that if the length of data in the column is 256 bytes or less then the whole text is retrieved other wise it gets truncated to 256 bytes.

I am using ADO 2.7 and am using the getchunk method of ADODB.recordset. Can you please tell me what could be the issue here?

Thanks

How To Pass A Long Data Type To A ADO.parameter?
I want to know how to pass a long data type to an ADO.parameter object. For instance if your parameter is a string you can set the Type property of the parameter to adVarChar or if its integer, Type=adInteger etc... Which constant would be used if your parameter is of data type long?

Thanks,

[Oracle][ODBC][Ora]ORA-01461: Cannot Bind A LONG Value For Insert Into A Long Column
Using the Oracle in OraHome92 version 9.002 ODBC driver in visua basic I receive the message "[Oracle][ODBC][Ora]ORA-01461 cannot bind a LONG value for insert into a long column" whe updating a large table a table with 59 columns. The proble seems to be related the number of columns being updated or th size of the data. I am using a recordset object to perform th update. If I limit the number of columns I update, the updat works successfully. On smaller tables, the update work successfully.

Oracle Clob Data Type
I am using VB to read an oracle database, and on the open command i get a "Data type not supported" error. The database has a field that is a CLOB data type, anyone with ideas on how to get around this?

DATA REPORT && Oracle Numeric Type
Hello all

I have created an parameterised group report from oracle using a data environment and data report designer. It all works ok apart from I try and add a function in it reports back "Data Type Mismatch in Function1". This Function1, is in the group footer section and all it does is sum a numeric field.
This seems to be the main problem, that is that Oracle uses a generic numeric type and probably VB is expecting something more specific (i.e. Long Integer )
Any suggestions are welcome.

Thanks
:(

"LONG RAW" Data Out Of Oracle Table
(VB6.0, Oracle 8.0, NT4/5.5)
Hi
I have an Oracle table where one field contains data of the type "LONG RAW".
Anybody know a way to visualize the contents of such a field? (I only want to display it, not work with it at all)
Loading the table into a DataGrid, the field in question only displays an "unknown character" (sort of a thick vertical line). A MSHFlexGrid does not show the field at all.
Any suggestions? Thanks
----Silvia Hansel----

Long Is Faster Yet It's 4 Bytes And Integer Is 2 Bytes, And Other Data Type Questions
I read in the MSDN library that a long data type should be used whenever possible because it is the processors native data type and therfore more efficient. Why is this if it's 4 bytes and the integer is 2 bytes?

Also, it sayed you should only use decimal when absolutely neccessary when dealing with math so that the math co-proccessor is utilized less. What data type can I use that when divided by an indivisable value won't return a decimal value? I usually use the round() functiln.

Any help would be great thanks.

Run-Time Error Filter Is To Long
I am using Access 2000 VB
I use the following code to allow the user to select items from a ListBox to be printed in a report . If the user selects more than 50 items I get a Run_Time Error #7769 "Filter cancelled because it is to long"

If anybody has a fix to this proplem it would be greatly appreciated.

Thank You

Private Sub cmdPreview_Click()
Dim vntItem As Variant, strFilter As String
Dim rptMyReport As New [Report_Count Sheet Report]


For Each vntItem In Me![1stProduct].ItemsSelected
' Concatenate single quotes around the customer id
' because the CustomerID field is Text.
strFilter = strFilter & "[ProductName] = '" & _
Me![1stProduct].ItemData(vntItem) & "' OR "
Next
' Remove the OR string from the end of the filter
' condition if a filter exists.
If strFilter <> "" Then
strFilter = Left(strFilter, Len(strFilter) - 4)
' Preview the report, and pass the filter string
DoCmd.OpenReport rptMyReport.Name, acPreview, , strFilter
Else
MsgBox "No Products Have Been Selected"
End If

End Sub

[RESOLVED 10 Mins Down To 25 Seconds]this Filter Takes To Long .. Is There Any Other Way?
Hey all,

I have a spreadsheet full of data of which i need to filter out (delete) all rows that start have certian lines in their A column. I have tried 2 things thus far and both of them take forever. I need to know if there is possibly a quicker way of doing this .. here are my 2 attempts...

Code:Sub CleanUp() 'Eliminates unwanted lines

Dim oApp3 As Excel.Application
Set oApp3 = New Excel.Application
Dim objWorkBook As New Excel.Workbook
Dim X As Integer

VBA.FileSystem.ChDir "F:Inventory"
    oApp3.Workbooks.Open FileName:= _
        "F:InventoryAuditTest.xls"

Set objWorkBook = oApp3.Workbooks("AuditTest.xls")

For X = 2000 To 1 Step -1

If objWorkBook.Worksheets("dbo_AUDIT_DV_DEVICE_DUPLICATE_A").Range
("A" & X) = "AUDIT FAILURE" Or objWorkBook.Worksheets("dbo_AUDIT_DV_DEVICE_DUPLICATE_A").Range("A" & X) = Null Or .....''''many Or's

Then

    objWorkBook.Worksheets("dbo_AUDIT_DV_DEVICE_DUPLICATE_A").Range(X & ":" & X).Delete

End If
Next X
'Save
    oApp3.Windows("AuditTest").Activate
    oApp3.DisplayAlerts = False

    oApp3.ActiveWorkbook.SaveAs FileName:="F:InventoryAuditFinal.xls", FileFormat:= _
        xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
        , CreateBackup:=False

'Quit and Exit
oApp3.Quit
Set oApp3 = Nothing
Set objWorkBook = Nothing

End Sub


Attempt # 2

Code:Sub CleanUp() 'Eliminates unwanted lines

Dim oApp3 As Excel.Application
Set oApp3 = New Excel.Application
Dim objWorkBook As New Excel.Workbook
Dim oRange2 As Range

Dim X As Integer

VBA.FileSystem.ChDir "F:Inventory"
    oApp3.Workbooks.Open Filename:= _
        "F:InventoryAuditTest.xls"

Set objWorkBook = oApp3.Workbooks("AuditTest.xls")

For X = 5000 To 1 Step -1


If objWorkBook.Worksheets("dbo_AUDIT_DV_DEVICE_DUPLICATE_A").Range("A" & X) = "AUDIT FAILURE" Then
objWorkBook.Worksheets("dbo_AUDIT_DV_DEVICE_DUPLICATE_A").Range(X & ":" & X).Delete
End If

If objWorkBook.Worksheets("dbo_AUDIT_DV_DEVICE_DUPLICATE_A").Range("A" & X) = Null Then
objWorkBook.Worksheets("dbo_AUDIT_DV_DEVICE_DUPLICATE_A").Range(X & ":" & X).Delete
End If

.'' many if end ifs...
.''
.''


Next X
'Save
    oApp3.Windows("AuditTest").Activate
    
    oRange2("A1").Select
    
    oApp3.DisplayAlerts = False

    oApp3.ActiveWorkbook.SaveAs Filename:="F:InventoryAuditFinal.xls", FileFormat:= _
        xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
        , CreateBackup:=False

'Quit and Exit
oApp3.Quit
Set oApp3 = Nothing
Set objWorkBook = Nothing

End Sub

Hmm, I got another idea: Check for criteria, if there is a hit enter row number into an array, at the end of the list delete all the rows that have row numbers in that array? would that make this go faster or is the bottleneck checking numerous search critera?

Thx

Thx in advance
Doc




Edited by - doctor on 7/23/2004 6:54:59 AM

Filter Too Long - Dynamically Create Sql String For DoCmd.OpenReport
I hope I'm this is not too much for one day but I'm hoping that someone might have a suggestion or possible solution.

I am trying to dynamically create a query and use it in a report however have ran into the following problem.

In the code below I try to accomplish the following:
1. create the query criteria or filter string
2. Use the resulting string as a filter for DoCmd.OpenReport

The problem I am running into is:
Run-time error '7769'
The filter operation was cancelled. The filter would be too long

Reason: The maximum length of the wherecondition argument is 32,768 characters

I don't know how to accomplish what I'm doing here any other way at the moment. I could assign the query string to the recordsource but I ran into problems with this before .... I think this is a problem as well because you cannot assign the sql string to the reports record source until after the report has been opened.

Here's the code if you need a look:

Do Until rs.EOF
Client_Number = rs!Client_Number

If counter = 0 Then
strCriteria1 = "(([qry_Contactinfo1].Client_Number = " & rs!Client_Number & ")"
Else
strCriteria1 = strCriteria1 & " Or ([qry_Contactinfo1].Client_Number = " & rs!Client_Number & ")"
End If


counter = counter + 1

rs.MoveNext
Loop
rs.Close

strCriteria2 = ") AND ([qry_Contactinfo1].RD_Number = " & strRD & " OR [qry_Contactinfo1].RD_Number = " & intRetail & ")"
strCriteria3 = strCriteria1 & strCriteria2

DoCmd.OpenReport stDocName, acPreview, , strCriteria3

Oracle ADO Recordset Filter Problem
Hi guys

I've pulled out some data using an ADO connection and recordset to an Oracle database and have been using the following code to filter the recordset:


VB Code:
rstDatabase.Filter = " ZYC_PRICE = 1674 "


but when I try to filter with a decimal amount i.e,


VB Code:
rstDatabase.Filter = " ZYC_PRICE = 0.7 "


it doesn't filter the correct records.


Can anyone shed some light on this?


Many thanks

Pobo

Long Fields Oracle And VB
I am using VB6 and oracle.I want to insert a long field in a table. what insert statement shoud i use??
I use the insert sql statement. But Oracle gives me an error. "The string is too large..."
please anyone help me. it is a bit urgent.

Saving And Retrieving Text Rpts Into A Long Raw Field (Oracle)
Hi,

What is the quickest way to insert a report (word doc imported into a rich textbox control) using ADO into a long raw (Oracle) field? Would you recommend the stream object without Append/Get Chunk, vice versa, or the use of both. If you have done this yourself, any insight will be greatly appreciated - especially if you were able to do so with little difficulty! I have used ideas from Microsoft's support site (using the append/getchunk methods), however, am getting garbage along with the text. I have run out of ideas.

Thanks!

HELPPPP!!!! How To Show A Long Raw Field From Oracle In Visual Basic's Picture Box
hI,

I NEED TO HOW A LONG RAW ORACLE 'S FIELD, IN A VISUAL BASIC'S FORM.
HOW CAN I DO THAT?

PLEASE HELP ME IS URGENT!!!

THANKS IN ADVANCE

Filter A List Box For More Than One Type
I am filtering the contents of a ListBox using:

Code:
ListDir App.Path & "app", "*.exe"
This shows only exe files, how do I make it show .lnk also?
I just can't seem to get the syntax correct

Filter Out File.Type's
How do I filter out File.Type of the oFiles Var? I tryed using an if then statment but I kept geting an unexpected 'If' Error.
This is my code below

VB Code:
sub GetDir(dir)  dim fh3,oFolder,oFolders,oFiles,Item2   set oFolder=oFileSys.GetFolder(dir)  set oFolders=oFolder.SubFolders  set oFiles=oFolder.Files      For each item2 in oFiles    set fh3=oFileSys.openTextFile(strInput & strTarget,8)    fh3.WriteLine(item2.Name)    fh3.close      nextend sub

Long Type To UDT
Hello.

How do I cast a long to a UDT?
the long type value is a return from an API function.

UDT:

Code:
Public Type NewEventData
Result As Long
UserId As Long
UserNum As Long
End Type


I tried using CopyMemory but my app crashes when I use it.

help please.
thanks in advance.

SQL Server - The Conversion Of A Char Data Type To A Datetime Data Type Resulted.....
Hi All

I have developed an application with vb6.0 and sql server 2000 database and working well on my desktop.

While client saving records in db, sometimes they are getting following error.

"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."

I'm using ADOs and code like this...

rstCustomer("joindate") = mskJoinDate
rstCustomer("jointime") = mskJoinTime
rstCustomer.Update

' Here mskJoinDate is maskedit control, contains date in dd/mm/yyyy format only.

' Here mskJoinTime is maskedit control, contains Time in hh:mm format only.

' Both are datetime fields in database.

' These two fields won't contain any other data because I have done perfect validation before assign values to recordset.

Anybody have idea about my problem? Please help me to solve this.

Thanks in advance
Pradeep

Adding Filter In Search Procedure
This is my search code, I had a lot of help on this (it's probably a copy paste of a solution given by herilane, and I had a lot of help by others as lebb, tinyjack and timbo -not to mention those whose names don't to mind instantly)


Code:
Public Sub FindCert()
Dim objExcel As Excel.Application
Dim ws As Worksheet 'worksheet we're working with
Dim intCol As Integer 'column to search
Dim lngLastRow As Long 'last row in column
Dim rng As Range 'range to search
Dim rngFound As Range 'hold the result of each search
Dim strFirstFound As String 'store the address of first match
Dim Results() As Long 'hold the results
Dim allResults(65536) As Long
Dim i As Integer 'for printing the results
Dim ChNr_index As Integer
Dim NoHits As Boolean
Dim t As Integer
Dim itmX As ListItem
Dim clmx As ColumnHeader
Dim BarSize As Single

blSearch = True
DoEvents
Animation

BarSize = 0
FrmPEDinvoeren.ProgressBar1.Value = BarSize
FrmPEDinvoeren.ProgressBar1.Visible = blSearch
FrmPEDinvoeren.Label19.Visible = blSearch
'initialize
FrmPEDinvoeren.MousePointer = vbHourglass
NoHits = False
Set objExcel = Nothing
Set ws = Nothing

Set objExcel = New Excel.Application
ChDrive (CurrentDrive)
ChDir (CurrentDir)
objExcel.Workbooks.Open FileName:="F:DATAPEDExcel 3.1B3.1b.xls"
NrCert = 1
NoHits = True
For ChNr_index = 1 To aantal '6
If strToFind(ChNr_index) = "" Then
Else
intCol = 1
ReDim Results(0)
DoEvents
'where to search
Set ws = objExcel.Worksheets(1)
lngLastRow = ws.Cells.SpecialCells(xlCellTypeLastCell).Row
Set rng = ws.Range(ws.Cells(1, intCol), ws.Cells(lngLastRow, intCol))

'start searching after the last cell, so the results come in the right order
Set rngFound = rng.Find(What:=strToFind(ChNr_index), after:=rng.Cells(lngLastRow, 1))
If rngFound Is Nothing Then
'NoHits = True
BarSize = BarSize + 25 / aantal 'FrmPEDinvoeren.ProgressBar1.Value
FrmPEDinvoeren.ProgressBar1.Value = BarSize
DoEvents
Else
strFirstFound = rngFound.Address
NoHits = False
Do
Results(UBound(Results)) = rngFound.Row

ReDim Preserve Results(UBound(Results) + 1)
Set rngFound = rng.FindNext(after:=rngFound)
DoEvents
Loop Until rngFound.Address = strFirstFound
'remove last, unused array element
ReDim Preserve Results(UBound(Results) - 1)

End If
DoEvents
BarSize = BarSize + 25 / aantal 'FrmPEDinvoeren.ProgressBar1.Value
FrmPEDinvoeren.ProgressBar1.Value = BarSize
'print the results
For i = 0 To UBound(Results) ' was 1 to ubound(.. JS)
DoEvents
Debug.Print Results(i)
If Results(i) <> 0 Then 'js
allResults(NrCert) = Results(i)
NrCert = NrCert + 1
End If
DoEvents
Next i
End If
DoEvents
BarSize = BarSize + 25 / aantal 'FrmPEDinvoeren.ProgressBar1.Value
FrmPEDinvoeren.ProgressBar1.Value = BarSize
Next ChNr_index

If NoHits = True Then
MsgBox "Er zijn geen 3.1b certifikaten gevonden bij de opgegeven Chargenummers"
Else
DoEvents
' fill ListView
' fill array for printing
' Stop and hide animation
' Progressbar --> 100% then stop and hide
' Show results in a new window
end if
objExcel.Application.Quit
Set objExcel = Nothing
Set ws = Nothing
NoHits = False

End Sub

So -what's wrong with it? Nothing, I want to add a filter. Of for instance
a number is "657" it returns everything with 657: A657, 65734, 45657 etc.

The reason I'm not free-wheelin', gung-ho -ing, buckaroo-ing into this with "if- then-else" statements or other test, is that i want to know this first:

Does Excel have it's own filter option/property or do I have to programme one?
Is there a filter option in EXcel?

ADO Recordset Filter (Compund Search )
Hello Again,

Can anyone help me, this problem is bothering me for a long time, I want to Filter 2 fields but error mismatch is generated. Heres my code

adoRecordSet.Filter = "Field1 = '" & varFilter1 & "'" And "Field2 = '" & varFilter2 & "'"

This is the case, I want to search out only 1 record in the Form Entry.

Please Help ...

How To Filter Forms By Search Criteria
Program: MS ACCESS 2003
Code: VB

Hey all. I was wondering if someone can help me out a bit. I am creating an Access database for my job. I have created a form that stores information about patients, including which doctor is seeing which patient. The Table that stores all the info is called "Patients". The fields in this table are: Study #, Doctor, Patient Name, Patient Number. There is no primary key in this table.

Once a user opens the form, he will be presented with the first record identical to the table, which is filed by the Study #. I would like to put a SEARCH button on the form that will prompt the user to enter a study #. Once the number is entered it will filter the FORM to only display the results for that Study # and show them in the FORM.

I am able to do this quite well using queries but the only drawback is that the information is presented in TABLE format. I would like a search button on the form and the results to be filtered on a form, if possible.

I know this is a lot of work, but I'm stuck. I appreaciate every, and any help.

Thanks,
Scott

Empty FTP Long To Search
Ive written a class to handle ftp functions using the Microsoft Internet Transfer Control. Everything works great except one case.

When I do a DIR command on an empty or nonexisting folder it takes about a minute to respond. Why is this the case?

Thanks

Jonathan Steel

Filedialog Saveas Filter Type?
Hi everybody!

I wrote a macro wich converts an excel sheet to a postscript page, and this starts with a filedialog type 'save as...' but when I try to set the filter type to "*.ps" vba says that's not allowed? Someone knows how to set the filter of a 'save as...' dialog?

Thanx!

SHBrowseForFolder Filter By File Type?
i have some code that pop up a brower dialogue using the SHBrowseForFolder API. however i want it to only show file type that end in ".grd". does anyone know how this can be done? thanks

-hinchdog

Unix Type Of Filter Program
What I'm trying to do is a Unix type command line filter program to read stdin and output to stdout i.e. c: empdir | myfilter | more


Any help is greatly appreciated


thanks

Save Long Type
Hi Folkz, i have a question (really? ):

i have to say a long type.
Es.


Code:
Public Type TypeExample

Pasta as string
Pizza as boolean
Spaghetti as variant
.
.
.

End Type

Public Food as TypeExample
how can i save with a functions this structure?

a thing like WriteType #1, Food

does exist anything like this?

Sorry for my english

Overflow Even With Long Type
hi,
i have a long type variable for division operation...but i always get
runtime error '6': overflow.....code is like below

Dim formula_result As Long

formula_result=40000/5561

then it crashes...

what can i do about that?

Converting To Long Type
anybody know how to convert a c-type 64 bit integer to long type in vb?
i tried CLng() but it results in an error because it is out of range..

such as -11644473599 converted to 1240428289

any suggestions?

'The Conversion Of A Char Data Type To A Datetime Data Type Resulted In An Out-of-ran
Hi,

I am writing a SQl query in visual basic by startdate and end date. It works fine in SQL server and Query Analyser but when query comes into visual basic it error and the message is 'The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.'

The code:

declare @cMonth int, @year varchar(10), @first_sDate datetime, @first_eDate datetime, @Second_sDate datetime, @Second_eDate datetime
set @cMonth = datepart(month, getdate())
set @year = datepart(year, getdate())
set @first_sDate = @year + '-01-01' + ' 00:00:01'
set @first_eDate = @year + '-06-30' + ' 11:59:59'
set @Second_sDate = @year + '-07-01' + ' 00:00:01'
set @Second_eDate = @year + '-12-31' + ' 11:59:59'

if @cMonth <= 6
begin
select *
from pub
where created_date BETWEEN @first_sDate and @first_eDate
end
else
begin
select *
from pub
where created_date BETWEEN @second_sDate and @second_eDate
end

In here two sets of data need to represent first six month and second six month.

how do change varchar to datetime? I tried convert but didnot work. Any body can help with the code? The error caused only in visual basic.

Many Thanks

Bravo

Long Time I Search For This Code.please Help Me
[FONT=Arial]First: VB6 does support Arabic lang?

In Vusual Basic 6 can I make certain text . under this text line . and some one read / recite this text and the line follow the read / sound under the text.

can I make search button to search specific word inside this text
and bring this text which contain this word.

please I nead code

please help me

thankful
[/font]

Adodc Filter For Date In Text Type
Dear gurus,
Can anybody be of my help?
I use msaccess 2000,adodc1,mshflexgrid1 in vb6 enterprise edition
in the database named db1 I have a 2 fields: dts & names(both text type). I show the data in mshflexgrid.I didnot make the dts field date/time type because in the flexgrid the date shows as 2006-02-20. But I want to show as 20/02/06. When I use the filter, the date query is not executed. I have 2 textboxes in the form showing the period between 2 dates.
I use like:
command1_click()
adodc1.recordset.filter="dts=>'" & text1 & "' and dts=<'" & text2 & "'"
end sub

pkb_pkb


pkb_pkb

Convert Type Long To Date
Hello everyone,

Please tell me how can I convert a type long ("20031217180537011") into datetime format!

Thank you in advance!
Best regards

Tpe Mismatch Using Long Variable Type
I am not sure what the problem is here - maybe someone can help me out fairly easily.

I Dimmed variable as long, Value at run-time is 123456789 (test figure), and it is coming up as type mismatch error

In the global decs I have:

Code:
Dim gstrUnKey as Long


In the private sub, I have:

Code:
If IsNumeric(gstrUnKey) & gstrUnKey > 0 Then
'this creates the error when variable = 12345678 or 123456789

Type Mismatch...Data Type Vs. Host Data Type?
I keep receiving the "Type mismatch" error, and I think it stems from several fields containing dates which I am trying to update into a MS Access database. What I am trying to determine is what would be the proper settings for the "Data Type" and "Host Data Type", under the Parameters tab in my Command properties? The format I am hoping to achieve is mm/dd/yyyy. (This is already correctly set in my Regional Settings.) I hope this makes sense...I have been searching the forums and haven't found any descriptions yet of the various options for these two settings.

Long Time Search Record In DBF Problem
i write program to connect to database .dbf and search record

Adodc1.ConnectionString = "FILE NAME=C:Kartotekamagazyn.DSN"
Adodc1.RecordSource = "magazyn"
Adodc1.Refresh
Adodc1.Recordset.Filter = "NR_ROL = " & NR.Text
Set DataGrid1.DataSource = Adodc1

all work fine but the dbf file has 3000 of records and this program search a record about 30 seconds so i download MySQL because i hear that SQL search faster - but i'm new and i don'y know how to use MySQL in VB6
Second a hear that need to indexing a DBF file... and this help - an you tell me how a an indexes dbf file ???? please help

SQL Query From Two Tables Based On Formatting Type Filter
All,

Problem: I'm trying to do a SQL query on a field in a table and I need to pull the text out of the entry where formatting is:

textIwant_number.thefileextension

For example:

P-DP 1022_0900412a803cc7aa_V4x0.pdf -- Here I want to extract the P-DP 10022... and put it into another column.



S-ZA 1001_0900412a803cfc66_V1x0.pdf -- and again, i want to pull out the S-ZA 1001


P-DP 1033_0900412a803d4deb_V2x0.pdf -- the P-DP 1033 from this string



S-LA 1004_0900412a803d6cf8_V1x0.pdf - and so and and so forth..
S-DE 1001_0900412a803d4e47_V1x0.pdf
P-DP 1021_0900412a803d5fe9_V1x0.pdf
S-CA 1001_0900412a803d7196_V1x0.pdf
A-PA 1001_0900412a803d82de_V2x0.pdf
P-SP 1002_0900412a803d45bb_V1x0.pdf
P-CE_1004_3.0_0900412a803e0075.pdf



So, I need everything to the left of the first " _ " (underscore) encountered. This is a tough query to figure out because the underscore is pretty much the only normalized, somewhat consistent factor I have in which to do a parse...

Any ideas?


Help greatly appreciated!

Mellencolie

What's The Fastest Variable Type? Long, Integer, Etc...
Long, Integer, Single, etc.. Could someone who knows a little about the compiled code respond with the order from fastest to slowests, all of the VB variable types? Thanks for your help.

Type Or Class For My Project? ...and Intro (kinda Long, Sorry)
Hi,

I am an old guy who just won't stop trying to learn to program in spite of the strong recommendation of friends and family. I started with Extended Color Basic in 1980, went through DOS batchfiles, C console apps, HTML and JavaScript and most recently failed to really learn C++. I do fine with straighforward scripting in things like PovRay and GameMaker, but until this last year haven't really had time to dig into the more complex issues of a real language. I mostly do Computer Animation, having made a little money at it over the years. But now I really want to learn to program right.

I'm using VB6, the MSDN site (since my version of MSDN won't seem to install right), "Visual Basic 6 Complete" by Steve Brown, and sites like this.

I seem to be doing better this time around, some of the concepts seem to be sinking in. My goal is to create some of the little handy programs that I keep searching for on the internet and which keep turning into overly complex suites while going from freeware to Commercialware and having spyware added.... deep breath ... rant over...

Anyway, right now I am trying to learn more about the care and feeding of user defined types, but I think my project might actually work better with a class or two.

The program is a math testing program which measures the time and percent correct of a range of problems. The user can set the operations used, the range of values to be added, subtracted, multiplied or divided, a few other things like how problems are displayed or how the answers are entered.

It -should- also keep track of an array of students, allowing them to call up their settings, keeping a graph of their improvement, and adding to the challenge factor as they learn.

I believe I can easily do it all without types or classes, in fact, I am just duplicating a program I wrote in a scripting language (GML). But the WholeIdea™ is to learn about VB, This week, specifically types, but in general, good programming techniques.

So I was thinking, from my fairly ignorant proceedural background, and from reading the "Class vs Module" debates on this board, that maybe Classes would be better for my purpose.

I have at least two prospects applying for the position of Class. First I have "Equations", a "Thing" that must hear "range1", 'range2', 'operation' and "format" and must do "Randomize", "don't match operand pair", "don't match neighbor" and "compare answers"... etc. I will have a varying number of these, depending on user settings and student ability.

Also I have 'Students' who have Histories, Scores, Settings(Format,PrintOptions,etc.), Passwords and TeacherSettings etc., and who must do, obviously, "Their math homework".

Formerly I have saved these in an INI style file and read them into various global.arrays. But in the interest of learning what I really -should- do, I want to rewrite them with Types... or maybe Classes if it is the better solution.

Opinions? Thanks in advance. ...and thanks in retrospect for the info I have recieved from your past posts. Great reading over these last weeks.

Bill, the KodeWorrier, apologizing for the lengthy essay.

Oracle Search On String
I forgot a underscore....

Hi Please help if you can

I am trying to do a search of my oracle db using this code

Code:
Dim ds As New DataSet

            Dim myCommand As OleDbDataAdapter

            sql = "Select LGP_NUM, STATUS, REGION_ENV, CENSUS_POPULATION FROM THM_VIEW WHERE COMMUNITY_NAME = '" & mystring & "'"

            myCommand = New OleDbDataAdapter(sql, conn)
            myCommand.Fill(ds, "THM_VIEW")
            dgresults.DataSource = ds

            dgresults.DataBind()


but the code comes up with an error of this

One or more errors occurred during processing of command. ORA-00920: invalid relational operator
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: One or more errors occurred during processing of command. ORA-00920: invalid relational operator

Source Error:


Line 127:
Line 128: myCommand = New OleDbDataAdapter(sql, conn)
Line 129: myCommand.Fill(ds, "THM_VIEW")
Line 130: dgresults.DataSource = ds
Line 131:
 





Edited by - Lesviper on 3/7/2005 11:24:18 AM

Msflexgrid - Highlight Entire Row, Add Rows, Search The Database, Filter Results
hi! i got a code here that can perform everything that is in the title.. for those who are using flexgrid in VB6, you can rely to this code..

there's just 2 glitches with this code.. 1st one:

for example, user searches for record "A"; the program found record A and would highlight that one with its text in bold style.. issue: msgbox "record not found" would prompt the user even if the record was already found or do exists.. can you guys help me with that?? i included a msgbox that would prompt the user if the record does not exist but it also interferes with my existing records..

2nd one:
for example, i can search the database linked to flexgrid1.. the search result would be highlighted with its text in bold style.. it would also filter the results to flexgrid2 so that the user wont have to scroll for other records with similar names.. problem with this code is if i have 3 records as the result:

A
B
C

it will appear in my flexgrid2 like this:

A
B
C
A
B
C
A
B
C

so now, it keeps on showing duplicate results.. is there anyway that i could avoid that??

anyway, here's the complete code that i used:


Code:
Private Sub Command1_Click()

Dim target_name As String

MSFlexGrid1.FillStyle = flexFillRepeat
MSFlexGrid1.Col = 0
MSFlexGrid1.Row = 0
MSFlexGrid1.ColSel = MSFlexGrid1.Cols - 1
MSFlexGrid1.RowSel = MSFlexGrid1.Rows - 1
MSFlexGrid1.CellFontBold = False
MSFlexGrid1.CellBackColor = &H80000005

MSFlexGrid1.FillStyle = flexFillSingle

For i = 0 To MSFlexGrid1.Cols - 1
For j = 1 To MSFlexGrid1.Rows - 1

target_name = TEXTSEARCH.Text
target_name = LCase$(target_name)

If LCase$(MSFlexGrid1.TextMatrix(j, i)) = target_name Then 'searching
MSFlexGrid1.Col = i
MSFlexGrid1.Row = j
MSFlexGrid1.ColSel = MSFlexGrid1.Cols - 1
MSFlexGrid1.CellFontBold = True
MSFlexGrid1.CellBackColor = &H80FFFF
TEXTSEARCH.SetFocus

MSFlexGrid1.Col = 1 'flexgrid1 (column1) will be copied to flexgrid2 (col1)
MSFlexGrid2.Col = 1
MSFlexGrid2.Text = MSFlexGrid1.Text

MSFlexGrid1.Col = 4
MSFlexGrid2.Col = 2
MSFlexGrid2.Text = MSFlexGrid1.Text

MSFlexGrid1.Col = 8
MSFlexGrid2.Col = 3
MSFlexGrid2.Text = MSFlexGrid1.Text

Dim oldRow As Long 'filters results and also the 2nd glitch
Dim lngRow As Long
Dim lngCol As Long

MSFlexGrid2.Rows = MSFlexGrid2.Rows + 1

For lngRow = MSFlexGrid2.Rows - 2 To MSFlexGrid2.Row Step -1
For lngCol = 0 To MSFlexGrid2.Cols - 1
MSFlexGrid2.TextMatrix(lngRow + 1, lngCol) = MSFlexGrid2.TextMatrix _(lngRow, lngCol)
Next
Next

elseif LCase$(MSFlexGrid1.TextMatrix(j, i)) <> target_name Then '1st glitch
msgbox "record not found"

End If

Next j
Next i

End Sub

Oracle Object Type
Hi
Can I work with Oracle Object Type in a Vb project.
Using the ADO recordset for a table in Oracle that one of its field is an object type caused an unspecified error.

Thanks

Oracle USer Defined Type
I have an oracle stores procedure (supplied by Oracle so I cannot change the procedure) that has its own type as a parameter.

Here is the stored proc heading

PACKAGE BODY IBE_ATP_PVT AS
/* $Header: IBEVATPB.pls 115.14 2001/05/08 15:25:22 pkm ship $ */

g_pkg_name CONSTANT VARCHAR2(30) := 'IBE_ATP_PVT';

PROCEDURE Check_Availability (
p_quote_header_id IN NUMBER,
p_date_format IN VARCHAR2,
p_lang_code IN VARCHAR2,
x_error_flag OUT VARCHAR2,
x_error_message OUT VARCHAR2,
x_atp_line_tbl IN OUT ATP_Line_Tbl_Typ
)
IS

c_api_version CONSTANT NUMBER := 1.0;
c_api_name CONSTANT VARCHAR2(30) := 'Check_Availability';

l_date_format VARCHAR2(30);
l_lang_code VARCHAR2(10);

l_qte_line_tbl ASO_QUOTE_PUB.qte_line_tbl_type;
l_shipment_tbl ASO_QUOTE_PUB.shipment_tbl_type;
l_atp_tbl ASO_ATP_INT.atp_tbl_typ;
i BINARY_INTEGER;
j BINARY_INTEGER;

l_quote_line_id NUMBER;
l_organization_id NUMBER;
l_inventory_item_id NUMBER;
l_quantity NUMBER;
l_uom_code VARCHAR2(3);
l_request_date DATE;
l_sysdate DATE;

l_return_status VARCHAR2(1);
l_msg_count NUMBER;
l_msg_data VARCHAR2(4000);
l_error_message VARCHAR2(4000);

E_IBE_ATP_BAD_DATE_FMT EXCEPTION;
E_IBE_ATP_NO_PREV_DATE EXCEPTION;

l_ship_site_use_id NUMBER;



How do I run this in VB??

I have created my own type

Public Type ATP_Line_TBL
QUOTE_LINE_ID As Long
ORGANIZATION_ID As Long
INVENTORY_ITEM_ID As Long
QUANTITY As Long
UOM_CODE As String
CUSTOMER_ID As Long
SHIP_TO_SITE_ID As Long
SHIP_METHOD_CODE As String
REQUEST_DATE As String
REQUEST_DATE_QUANTITY As Long
AVAILABLE_DATE As String
ERROR_CODE As Long
ERROR_MESSAGE As String
End Type

but when I

.AddParameter "x_atp_line_tbl", adParamInputOutput, adVariant, 10000, lines()

I get error message
Only user-defined types defined in public object modules can be coerced to or from a cariant or passed to late-bound functions/

Oracle Tables Linked In MS Access Need To Search
I have an MS access database that has table linked to an oracle database. I need to develop a query that search for a character string

example Select ID, Description from TableA where Description like "%computer%"

I want the result to show every ID that has computer somewhere in its description. What is the proper syntax. if I run the above example I get nothing, when I have looked in the table and know I should be getting records

any help would be appreciated

thanks

Cannot Convert Varchar To Search The Date In The Oracle 9i
Dear all,
Good Day. Currently, i am using the following sql coding to connect to the SQL Server 2000 to search the date.

++++++++++++++++++++

sqlCall = "SELECT productID, productName, stuRegisterDate" _
        & "FROM stockItem " _
        & "WHERE (CONVERT(VARCHAR, stuRegisterDate, 101) = '" & dateSearch & "')"

Note: stuRegisterDate = '2007/10/29 11:20:08 AND dateSearch = '2007/10/29'

++++++++++++++++++++


Then, i am trying to use the same sql coding to connect with the Oracle 9i database and search the date...
But, it was unsuccessful.

So, please, why i cannot use the (CONVERT(VARCHAR, stuRegisterDate, 101) to search the dateSearch (2007/10/29) in the Oracle 9i database, can anyone provide me some correct coding?

At the same time, i try to use the (CONVERT(VARCHAR, stuRegisterDate, 108), but, it still cannot work... ???

Many Thanks...
Regards,
Nicholas




Edited by - AbbydonKrafts on 1/21/2007 7:00:20 PM

Data Report, Filter Data Enviroment With User Input
Hi,
Im using VB6 and have a data report with a data enviroment. The data enviroment runs off a query in my access db which combines the adviser with there rotas. The results of the query are a long list of everyone in the db and there rota which is fine. In my interfcae ive got a form called frmselectrota which has a text box, i need the user to be able to enter there ext number (unique) and then when a button is clicked the datareport will be filtered to show only that person rotas. Ive been looking around and i cant seem to find a simple piece of code to filter the data enviroment... as the data enviroment runs frtom a access query there is no vb side sql...
any ideas greatly appriciated!!

Copyright © 2005-08 www.BigResource.com, All rights reserved