Creating new table with dao - howto retreive this in ado?

  • Hello!

    I create a new table with dao - how can I retreive this information with ado without restarting my application?

     

    - Lars


    -Lars

    Please only reply to this newsgroup. All mails would be bounced back.

  • Hi Lars,

    First off, is there any reason why you are using DAO to create the table?  You could use ADO to do this by using the ADO Extensions (ADOX), or you could simply run a CREATE TABLE script as a command through ADO.

    If you use ADO to create the table, then you can use the same connection to read from it afterwards.

    Even if you have to use DAO, there is no reason you cannot have a DAO and ADO connection to the same database at the same time.

  • I'm using this code:

    Public conTEST As New ADODB.Connection

    Public strConTEST As String

    Public Sub subConTEST()

    strConTEST = "Provider=sqloledb;" & _

    "Data Source=your_server_name;Initial Catalog=your_database_name;User Id=your...(or maybe sa);Password=your_password; "

    conTEST.Open strConTEST

    End Sub

    .......

    Dim cmdTEST As New ADODB.Command

    Set cmdTEST.ActiveConnection = conTEST

    Dim rsTest As New ADODB.Recordset

    Set rsTest = New ADODB.Recordset

    rsTest.ActiveConnection = conTEST

    rsTest.CursorLocation = adUseClient

    rsTest.Open "select * from TEST_TABLE", , adOpenDynamic, adLockOptimistic

    ......

     

    Bye,

    Rob

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply