|
-
Aug 16th, 2007, 12:15 PM
#1
Thread Starter
Junior Member
[RESOLVED] database Access using Vb
I am trying to get data from MS access table using the code below. I am using VB6.3 and I have created ODBC as my_cn point to database file (.mbd). When I run this code, I get a runtime error 3001 "Argumant are of wrong type, are out of acceptable range or are in conflict with one another".
When I click debug it highlights "rs.open..." code line.
Please let me kow what missing.
Thanks
Question_1
CODE:
Private Sub form_load()
Dim rs As ADODB.Recordset
strSQL = "SELECT * from MasterTable where SWCR = 13;"
Set rs = New ADODB.Recordset
rs.Open strSQL, my_cn, adOpenStatic, adLockReadOnly
retrieveValue = rs(0).Value
MsgBox ("value:" & retrieveValue)
rs.Close
Set rs = Nothing
End Sub
Last edited by sprasoon; Aug 16th, 2007 at 12:53 PM.
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
|