|
-
Mar 6th, 2001, 10:06 PM
#1
Thread Starter
Lively Member
Can anyone please help me out? This is critical and I am very frustrated! Help is greatly appreciated!
Here is my code:
Dim adoconnection As ADODB.Connection
Dim adoRecordset As ADODB.Recordset
Dim connectString As String
Dim sqlString As String
Dim visitorArray As Variant 'must be a variant
connectString = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=c:\temp\Steve.mdb;Jet OLEDB atabase Password=steve"
sqlString = "SELECT * FROM Money WHERE DatePerformed>=#" & Format(datWorkDatePer.Value, "mm/dd/yy") & "# AND (LastName) ='" & lblLastName & "';"
Set adoconnection = CreateObject("ADODB.Connection")
Set adoRecordset = CreateObject("ADODB.Recordset")
adoconnection.CursorLocation = adUseClient adoconnection.Open connectString
adoRecordset.Open sqlString, adoconnection, adOpenKeyset, adLockOptimistic
If (adoRecordset.BOF) And (adoRecordset.EOF) Then
MsgBox lblLastName.Caption & ", " & "you have no records entered for " & datWorkDatePer.Value & "."
Exit Sub
Else
Set DBGrid1.DataSource = adoRecordset
End If
endline:
adoRecordset.Close
adoconnection.Close
******
When I run the app and I choose the date (an existing record,) i get:
Run Time 430
Class does not support Automation or does not support expected interface
Stops on this line:
Set DBGrid1.DataSource = adoRecordset
What am I doing wrong? Can somone send me a zip of a small vbp that I can look at as an example? Help is greatly apprecaited and very hard to find during this time and age.
Stevie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|