SQL Compact with VB6
- Hi everyone,1. How can i open a SQL Compact connection in VB6 AppForce Mobile project?2. Which version of SQL Compact should i install? This VB6 AppForce Mobile project will be use in Windows Mobile 6.0.3. Which Reference/Component i need to add into my VB6 AppForce Mobile project?4. Please kindly provide sample VB6 source code on "ConnectionString".My mobile device will not contain any database and i wan to open SQL connection remote to SQL Database (.mdf) located in my XP Desktop to grab Data.Help....Thanks.
Answers
- Try to connect your PDA to PC, use Active Sync 4.5 if you don't have any driver for your PDA. You can download Active Sync here :
http://download.cnet.com/Microsoft-ActiveSync/3000-2094_4-10031823.html
The rest is coding it in your VB6. Open connection to Sql Server, grab data and store to Sql Server Compact.
Or you can use application to export data from Sql Server to Sql Server Compact. Use Data Port Console or Data Port Wizard from this site:
http://www.primeworks-mobile.com/
I used Data Port Console 1.5, and it worked for me ;)
Regards,
-HaRRiE-- Marked As Answer byChunSong Feng -MSFTMSFT, ModeratorTuesday, November 10, 2009 3:33 AM
All Replies
- Hi,
You can view the connectionstring @:
http://connectionstrings.com/sql-server-2005-ce
Read this first before you code using sql server compact DB:
http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx
Regards,
-Harrie- - Thank for reply,For normal SQL Server connection string , "Provider=SQLOLEDB.1;Initial Catalog=DATABASENAME_HERE;Data Source=PCNAME_HERE",For SQL Compact connection string, "Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Persist Security Info=False;Data Source=C:\Program Files\Microsoft SQL Server Compact Edition\v3.1\SDK\Samples\Northwind.sdf"I manage to open a connection with SQL Compact connection string above.Now, my questionCan i connect to a SQL Database (.MDF file) located in my Xp Desktop with SQL Compact CE with VB6 ADO connection ? If yes, how is the connection string look like?example, "Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Persist Security Info=False;Initial Catalog=DATABASENAME_HERE;Data Source=PCNAME_HERE"ThanksRegardshuhu
- "Provider =Microsoft.SQLSERVER.MOBILE.OLEDB.3.0; Data Source =c:\DataBaseFolder\myData.sdf; "
Remember, that Sql Server CE is a local database (mobile database), there isn't any server or client. You don't have to write PCNAME_HERE as Data Source - Ok..How can i connect to my Desktop SQL Server 2000 Database through PDA Devices? i'm using NON Dotnet code, VB6.HelpRegards,huhu
- Try to connect your PDA to PC, use Active Sync 4.5 if you don't have any driver for your PDA. You can download Active Sync here :
http://download.cnet.com/Microsoft-ActiveSync/3000-2094_4-10031823.html
The rest is coding it in your VB6. Open connection to Sql Server, grab data and store to Sql Server Compact.
Or you can use application to export data from Sql Server to Sql Server Compact. Use Data Port Console or Data Port Wizard from this site:
http://www.primeworks-mobile.com/
I used Data Port Console 1.5, and it worked for me ;)
Regards,
-HaRRiE-- Marked As Answer byChunSong Feng -MSFTMSFT, ModeratorTuesday, November 10, 2009 3:33 AM


