Results 1 to 5 of 5

Thread: [RESOLVED] database Access using Vb

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2007
    Posts
    20

    Resolved [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
  •  



Click Here to Expand Forum to Full Width