Re: Can Access open to SQL Compact Edition



Tom,

Here's a better link for SQLce training resources: http://www.microsoft.com/sql/editions/compact/default.mspx

--
Ginny


"Tom Holmes Jr." <tom@xxxxxxxxxxxxx> wrote in message news:eJ7iStcwHHA.2040@xxxxxxxxxxxxxxxxxxxxxxx
You might have seen my other rant about IIS ....

You said there was code before using RAPI (Remote API) where you moved the SDF from the device(PDA) to the laptop/desktop?
I might do that: 1) move the mile over 2) open to that file and do my own syncing 3) move the file back over and over-write the old file

Thanks!
Tom

"Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx> wrote in message news:7B666445-022B-4B4B-B77F-92D48B3C1EAA@xxxxxxxxxxxxxxxx
Tom,

The device side support isn't really there yet for Sync Services.

--
Ginny


"Tom Holmes Jr." <tom@xxxxxxxxxxxxx> wrote in message news:uZ4W7ERwHHA.4592@xxxxxxxxxxxxxxxxxxxxxxx
BTW ... I was wondering ...

Apart from using the Access/SQL Compact Edition service ....

Do you think the ADO.NET Sync Service would work ... or does this not work with devices yet?

"Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx> wrote in message news:A5AC9DC1-1EAA-4F31-8A9C-F3BCD1EB89D0@xxxxxxxxxxxxxxxx
Tom,

Here's some working C# I was able to find pretty quickly:

ADODB.ConnectionClass conn = new ConnectionClass();
conn.Provider = "Microsoft.SqlServer.Mobile.OleDb.3.0";
object recordsAffected;
ADODB.Recordset rs;
string data;
conn.CursorLocation = CursorLocationEnum.adUseServer;
conn.Open("c:\\SqlCe Testing\\Myfile.sdf", "", "", (int)ConnectOptionEnum.adConnectUnspecified);
rs = conn.Execute("select MyNVarcharColumn from MyTable", out recordsAffected, -1);
data = rs.GetString(StringFormatEnum.adClipString, 1, ",", "\r\n", "null");

I'm afraid that code also doesn't have the error checking you'd want in a production app, but maybe if you can get something like that to work you can go from there.

The Microsoft Mobile Development Handbook by Wigley, Moth and Foot has some good chapters on SQLce as well as lots of other good stuff and is definitely a book you'll want. I just got my copy last week.

--
Ginny


"Tom Holmes Jr." <tom@xxxxxxxxxxxxx> wrote in message news:OTRD5SOwHHA.3508@xxxxxxxxxxxxxxxxxxxxxxx
Hey Ginny, I wanted to thank you for the information. Let me show you some source code I have and it may look familiar.

=================================
Dim pConn As ADODB.Connection
Dim pRS As ADODB.Recordset
Dim connString As String

Set pConn = New ADODB.Connection
Set pRS = New ADODB.Recordset
'The PDA location
'connString = "Mobile Device\Program Files\Bristol_SmartDeviceCab1\bcmcp.sdf; Password =mypassword;"

connString = "C:\PROJECTS\BRISTOL\bcmcp.sdf; Password =mypassword;"
pConn.ConnectionString = "PROVIDER=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=" & connString
pConn.Open
=================================

So, I've tried opening this on the PDA, and I moved the SDF file manually to the desktop to try and edit it there. But I get this error:
-2147217887 Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

Thanks again for all the help. I'm buying the MS SQL Compact Edition and Mobile Development book when they come out.

Tom


"Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx> wrote in message news:OxuDyxNwHHA.3400@xxxxxxxxxxxxxxxxxxxxxxx
Tom,

SQLce has an OleDb provider that I have used from ADO to open a sdf file on the local computer, although I don't have any experience using Access for that. I haven't tried using it to open a connection to a SQLce database on a mobile device. Instead I use Rapi to copy the sdf file from the device to the desktop and then work on it on the desktop.

--
Ginny


"Tom Holmes Jr." <tom@xxxxxxxxxxxxx> wrote in message news:eEOTItNwHHA.4516@xxxxxxxxxxxxxxxxxxxxxxx
This may be helpful for somethings, but not everything.

So, let me ask again ... is it possible for me to open an .SD file on the PDA from Access on my laptop???
Perhaps using ADO?

"Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx> wrote in message news:E325D4A3-E906-49ED-A0FE-BCAB9CDF60B9@xxxxxxxxxxxxxxxx
Tom,

Check out the Access Database Synchronizer: http://www.microsoft.com/downloads/details.aspx?FamilyId=B967347A-5DD0-445C-8A9F-AEA3DB9EC4BC&displaylang=en

--
Ginny


"Tom Holmes Jr." <tom@xxxxxxxxxxxxx> wrote in message news:%238I2iREwHHA.4528@xxxxxxxxxxxxxxxxxxxxxxx
One of the requirements is that I push some data (a query) down to a table on the PDA.
The PDA is running MS SQL Compact Edition, will erase everything from that table (on the PDA) and replace it with this new data.

So ... from the Access side, I suppose I should just try to open to that database with ADO. The mobile device may or may not be connected .... if it's not connected, I would expect that the connection would just fail. Or .... what would be even fancier is if Access could call and API and find out if a device is connected or not. When a device is connected a button is enabled .... when a device is NOT connected the button would be enabled.

Anyway, the first question is more important. Just open up to a table on the PDA (using ADO) and try to make a connection. Can that be done? can anyone link me to some sample code? Thanks!

Tom









.


Loading