problem on a recordset for a ADODB connection.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kazper
    New Member
    • Jan 2007
    • 15

    problem on a recordset for a ADODB connection.

    I'm having trouble getting the right code for the record set.

    Dim adoItems As New ADODB.Connectio n
    Dim recItems As New ADODB.Recordset

    adoItems.Connec tionString = "Provider=MSDAS QL.1;Persist Security Info=False;User ID=MyUserID;Dat a Source=MyDataSo urce;Initial Catalog=MyCatal og"

    adoItems.Open ("DSN=MyDSNName ;UID=MyUserID;P wd=MyPassword")


    my real problem is getting the right recordset for recItems for my adodb connection.

    Hope you guys can help me out..

    Thanks in Advance
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Originally posted by kazper
    I'm having trouble getting the right code for the record set.

    Dim adoItems As New ADODB.Connectio n
    Dim recItems As New ADODB.Recordset

    adoItems.Connec tionString = "Provider=MSDAS QL.1;Persist Security Info=False;User ID=MyUserID;Dat a Source=MyDataSo urce;Initial Catalog=MyCatal og"

    adoItems.Open ("DSN=MyDSNName ;UID=MyUserID;P wd=MyPassword")


    my real problem is getting the right recordset for recItems for my adodb connection.

    Hope you guys can help me out..

    Thanks in Advance
    Hi. If I knew what recordset you wanted I could help you, but I don't as you did not say what you want to do.
    You are showing 2 connection strings for your connection object. If you set the connection string first, you don't need a parameter for the call to open.

    If you are just looking for a generic way to open a recordset then you need a SQL string

    Code:
    Set recItems = adoItems.Execute("SELECT * FROM MyTable")

    Comment

    • kazper
      New Member
      • Jan 2007
      • 15

      #3
      Thanks for the code :) that was the code that i needed ;) thanks alot

      Comment

      • willakawill
        Top Contributor
        • Oct 2006
        • 1646

        #4
        Originally posted by kazper
        Thanks for the code :) that was the code that i needed ;) thanks alot
        Welcome :)

        Comment

        Working...