Syntax to add recordset using ADO, ODBC Sybase driver

M

mc

Hi all

I am trying to import data into my Access d/b from a Sybase d/b. I can
connect to the Sybase d/b and read the data, but my question is how do I add
the data back to my Access d/b? Here is my coding:

Private Sub cmdImportData_Click()
On Error GoTo Err_cmdImportData_Click
Dim cnn As New ADODB.Connection, rst As New ADODB.Recordset, rst2 As New
ADODB.Recordset
Dim intRecordCount As Integer, strSQL, strSQL2 As String

Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset

cnn.Open "DSN=LON_ODINMM_DEV;" & "Uid=user1;" & "Pwd=xxx123"

strSQL = "Select * from consys_periods"

With rst
.Open strSQL, cnn, , , adCmdText

End With

I want to add to my table called tblconcsys_periods in Access. Thanks!
 
C

Clifford Bass

Hi,

I would suggest you create a linked table in Access to the table in
Sybase and then use an append query that selects from the linked table and
appends to the local Access table.

Clifford Bass
 
M

mc

Thank you.

Clifford Bass said:
Hi,

I would suggest you create a linked table in Access to the table in
Sybase and then use an append query that selects from the linked table and
appends to the local Access table.

Clifford Bass
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top