Export data to Ms Access 2000

Hello,

I have to push data from Notes in a table in Ms Access. I created an new database in Access, pricelist1 with a table, named table1. I filled one record with data manually within Access.

With an ODBC-connection in Lotus Script I can read that data. But am not able to export data to the Access-table “staffl”. No error-messages,

No “records” or rows are added.

This is my code:

Sub Click(Source As Button)

REM export to table

Dim con As New ODBCConnection

Dim qry As New ODBCQuery

Dim result As New ODBCResultSet

Dim r As String

Set qry.Connection = con

Set result.Query = qry

REM name of the ODBC-source:

con.ConnectTo(“Prijslijst_acc”)

qry.SQL = “SELECT * FROM stafll”

result.Execute

result.FirstRow

r=result.GetValue(“price”)

Messagebox r 'Gives the right value

result.LastRow

result.AddRow

Call result.SetValue(“price”, “102”)

Call result.SetValue(“artcode”, “ZZMEDE1”)

result.UpdateRow

result.Close(DB_CLOSE)

con.Disconnect

End Sub

The column-names “price” and “artcode” exists!

Koos van Harmelen

Subject: Export data to Ms Access 2000

I would consider using SQL statements to add records instead of using .AddRow:

qry.SQL = |INSERT INTO stafll (“price”, “artcode”) VALUES (“102”, “ZZMEDE1”)|

hth

Subject: Export data to Ms Access 2000

Just FYI you should be able to use the Lotus connectors, specifically the OLE DB connector, and dispense with ODBC.