Syntax to add recordset using ADO, ODBC Sybase driver

  • Thread starter Thread starter mc
  • Start date Start date
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!
 
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
 
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
 
Back
Top