Thursday, February 16, 2012

accessing SQL Server Compact Edition from VBA

Is it possible to connect to SQL Server Compact Edition with Visual Basic for Application?

I want to connect to *.sdf file from MS Access.

I suppose you can do it using OLEDB if VBA allows you to use COM objects (which you should know better as I've never used VBA).

|||

Thanks. I also suspected that, just was not sure is there OLEDB provider version for desktops, and how to access it. Just foud that information in one of the mahdi posts

Dim cnx As ADODB.Connection
Set cnx = New ADODB.Connection
cnx.ConnectionString = "Provider='Microsoft.SQLSERVER.MOBILE.OLEDB.3.0.';Data Source='c:\\B.sdf';"
cnx.Open

No comments:

Post a Comment