Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Connecting to SqlCE via Lisp

1 REPLY 1
Reply
Message 1 of 2
StephanKoster
550 Views, 1 Reply

Connecting to SqlCE via Lisp

I'd like to connect to a Microsoft SQL Server Compact 3.5-database.

In VB this works:

Dim oConn As ADODB.Connection
Set oConn = New ADODB.Connection
oConn.Provider = "Microsoft.SQLSERVER.CE.OLEDB.3.5"
oConn.Open "c:\test\test.sdf"

But translated to lisp like that:

(setq oConn (vlax-create-object "ADODB.Connection"))
(vlax-put-property oConn "Provider" "Microsoft.SQLSERVER.CE.OLEDB.3.5")
(vlax-invoke-method oConn "Open" "c:\\test\\test.sdf")

it does not work.

The error message when processing the last line is: 'Zu wenige tatsächliche Parameter' ('To few actual parameters').

Any idea someone?

 

1 REPLY 1
Message 2 of 2

To answer my own question: I have to change

 

(vlax-invoke-method oConn "Open" "c:\\test\\test.sdf")

 

to

 

(vlax-invoke-method oConn "Open" "c:\\test\\test.sdf" "" password -1)

 

and that works.

 

I wrongly thought these additional parameters were optional.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost