views:

34

answers:

1

I need to move my Sql Server CE database into MS Access, so my users who are familiar with Access can run queries on the data. Is there a free way to do that?

Thanks! David

+1  A: 

You have two options, you can either import the data into access or link the tables in access so the data stays in SQL CE and is just referenced by access.

I don’t think access can import it directly so you will have to make an ODBC connection to your CE file using the ODNC admin program in windows. Once you have done that you can move onto the next step

On the file menu go to get external data and then either import or link depending on what option you want, on the next dialog box select ODBC databases as the file type and select the ODBC connection you just made.

Follow the on screen prompts from there and Roberts your mothers brother

EDIT:

Sorry yes I did mean ODBC, my finger must have slipped on the keyboard. Anyway Yes it looks like the ODBC driver does not exist however a OLEDB driver does so you could open up the database in code using ADO and either manipulate it there or loop through each table and insert it into an access table you created earlier. Here is some code showing how to open a SQL CE recordset in VBA

Sub test()
Dim pConn As ADODB.Connection
Dim pRS As ADODB.Recordset
Set pConn = New ADODB.Connection
Dim cmd As New ADODB.Command
Set pRS = New ADODB.Recordset
' For 3.0 use PROVIDER=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0
pConn.ConnectionString = 
"PROVIDER=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=C:\Northwind.sdf"
pConn.Open

cmd.ActiveConnection = pConn
cmd.CommandText = "SELECT * FROM Products"
Set pRS = cmd.Execute
' Open the recordset
While Not pRS.EOF
    Debug.Print pRS(0)
    Debug.Print pRS(1)
    pRS.MoveNext
Wend
End Sub
Kevin Ross
Did you mean ODBC admin program in Windows? I cannot find any reference in Windows or Googling about ODNC admin program.In any case, I have not been able to find any ODBC driver for SQL CE. That would solve a lot of problems, but from what I've seen there is none in existence, and none in development! Do you know where to get an ODBC driver for SQL CE?
David Burson
I have edited my answer above in light of this
Kevin Ross
While this does not answer my question exactly - how to move a CE database into Access, it is definitely useful. Unfortunately, I lack the reputation to up-vote since I just started with stack overflow!
David Burson
I now have enough points to up vote your answer. btw, I ended up purchasing software to do this.
David Burson