When I run the following code I ger the "Object required (Error 424)" error. The debugger will point to the line that starts with "Set rs = cn.Execute("SELECT * ...". I know that the acctual error might precede this particular line. I am also trying to connent to the database without using DSN (acctualy, the database will be on the remote machine but I will deal with that problem later). I am kinda new to VB and I am thankful for any help I can get here...
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
'open the database and populate the Donors ListView
Set cn = New ADODB.Connection
cn.ConnectionString = "Driver=Microsoft Access Driver (*.mdb);DBQ=" & sDBLocation
cn.Open
Set rs = cn.Execute("SELECT * FROM Donor WHERE donorID = " & DonorData.donorID)
'adding data to the Donors ListView
While Not rs.EOF
Set itmX = lvDonors.ListItems.Add(, , rs!Donor_Name, 0, 0)
itmX.SubItems(1) = rs!Phone_Number
itmX.SubItems(2) = rs!Email
rs.MoveNext
Wend
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing Sylvano
dsylvano@hotmail.com
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
'open the database and populate the Donors ListView
Set cn = New ADODB.Connection
cn.ConnectionString = "Driver=Microsoft Access Driver (*.mdb);DBQ=" & sDBLocation
cn.Open
Set rs = cn.Execute("SELECT * FROM Donor WHERE donorID = " & DonorData.donorID)
'adding data to the Donors ListView
While Not rs.EOF
Set itmX = lvDonors.ListItems.Add(, , rs!Donor_Name, 0, 0)
itmX.SubItems(1) = rs!Phone_Number
itmX.SubItems(2) = rs!Email
rs.MoveNext
Wend
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing Sylvano
dsylvano@hotmail.com