Showing posts with label mobile. Show all posts
Showing posts with label mobile. Show all posts

Tuesday, March 27, 2012

Access database connection

I am running Visual Studios 2005 enterprise edition and I am creating a mobile application to keep track of some receipts. The problem I'm currently having is that even though I can connect to the MS Access Database with Server Explorer that I'll be aquiring data from; Everytime I attempt to use the Data Configuration Wizard to add a new data source that namely the database I get this error message:

The new connection uses a data provider that is not supported. (end of message)

There is no username or password necessary to access this database and it is an Access 2003 database.

Any help would be greatly appreciated.

Just to make sure...

You did change the Data Source to:

Microsoft Access Database File (OLE DB)

Which will use the following .NET Data Provider:

.NET Framework Data Provider for OLE DB

I assume you did in order to select the database, but I just want to make sure.

And when you click the button "Test Connection", it gives you that error?

Regards,

Dave

|||

Well that is the default settings so I just left those as they were and once I had figured out how to connect to the database thru server explorer, whenever I hit the test connection it said Connection ok. However the error message pops up when I attempt to add the database thru the add new datasource wizard.


|||Perhaps I'm missing something, but didn't you say this was a mobile app? Isn't the reason that VS is refusing to use the data source simply because the JET database engine doesn't run on mobile devices? -- Brendan Reynolds Access MVP wrote in message news:b986531d-b456-4194-af38-649f7db26f0d@.discussions.microsoft.com... >I am running Visual Studios 2005 enterprise edition and I am creating a
> mobile application to keep track of some receipts. The problem I'm
> currently having is that even though I can connect to the MS Access
> Database with Server Explorer that I'll be aquiring data from; Everytime
> I attempt to use the Data Configuration Wizard to add a new data source
> that namely the database I get this error message: >
> The new connection uses a data provider that is not supported. (end of
> message) >
> There is no username or password necessary to access this database and
> it is an Access 2003 database. >
> Any help would be greatly appreciated. >
>|||

To: Mr. Reynolds
I have no idea sir, I started the project as a smart device app, and in all the walkthroughs I have viewed nothing has been said about the Jet database engine being incompatible with mobile devices. If this is the case I'd like to know because this project is currently dependent on VS being able to connect with our Access database.


|||

I'm not sure of the limitations, you're best asking at the SQL Mobile Forum.

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=152&SiteID=1

Am moving this thread to there.

Here's some info on SQL Server 2005 Mobile Edition

http://msdn.microsoft.com/sql/mobile/default.aspx

Alex.

|||The JET database engine runs only on desktop and server versions of Windows. It's certainly possible to develop a mobile web app that talks to a JET database on the server, but if you need a local data store on the mobile device that will remain available when the device is not connected to the network, then you will not be able to use JET. Your alternatives - as I understand it - include SQL Server CE and XML. There is a database engine on the Pocket PC called 'Pocket Access' but it has very little to do with the desktop product, and there is no built-in support for 'Pocket Access' in the .NET framework. There is, however, a third-party component you could look at. There's an article on this at the URL below, and there's a link from the article to the vendor of the third-party component. Note that I haven't personally used this, and I don't know what plans, if any, Microsoft has to continue to support 'Pocket Access'. So this isn't a recommendation, just something that may be worth further investigation. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnroad/html/road10222003.asp There's an interesting article on 'Data Access Strategies for the Microsoft ..NET Compact Framework' at the following URL. Although the article dates back to the .NET 1.0 timeframe, I believe it is still relevant. http://msdn.microsoft.com/mobility/understanding/articles/default.aspx?pull=/library/en-us/dnnetcomp/html/dataaccessstrategy.asp -- Brendan Reynolds Access MVP wrote in message news:703e94a5-811d-4486-927c-34c62b34dc36_WBRev1_@.discussions.microsoft.com...
> This post has been edited either by the author or a moderator in the
> Microsoft Forums: http://forums.microsoft.com
> To: Mr. Reynolds
> I have no idea sir, I started the project as a smart device app, and in
> all the walkthroughs I have viewed nothing has been said about the Jet
> database engine being incompatible with mobile devices. If this is the
> case I'd like to know because this project is currently dependent on VS
> being able to connect with our Access database. > > > >
>|||Thank you for the information. Unfortunately I have a follow up question. If I were to make an intermediate SQL database to function as the go between for a SQL Mobile database and a Microsoft access database, is such a solution even possible? Our organization recently purchased VS 2005 on the assumption that it would be easy to use the .NET framework to develop a mobile app that would easily transfer data to an access database. Now with this new information its quite possible the data will go SQL Mobile -> SQL Database -> MS Access database.
Footnote:
The SQL Database would just function as a temporary store to check data generated from receipts made in the mobile database. Once the checks are done the corrected data would be passed to the MS Access database. Then the SQL database would wipe itself clean.
|||

Yes, but it makes no sense. To accomplish that you would have to purchase SQL 2000/2005 and pay CALs per device (or per CPU license). If that’s acceptable, simply get rid of Access and use much more powerful SQL you've paid for.

Alternative solution is to use Web Service to talk to Access database. Create couple WEB methods to talk to access and call them from device. Something like this should do:

DataSet GetAccessData(String command, …)

{

// Connect to Access DB here, execute command and populate data set with returned data.

return dataSet;

}

Bool UpdateAccessData(DataSet dataSet, … )

{

// Connect to Access DB here and update DB with data from Data Set.

return success;

}

|||To: Ilya
The enterprise edition that we purchased of VBS 2005 came with SQL server 2005 and I just installed it upon learning that I can't communicate directly with the Access database. I'm not sure if we still have to pay the CALS per device though.
If I used these web service methods where would I write them? In the upload and download portion of the code for the mobile app?
|||

I believe it comes with 5 CALs (to be verified).

These WS methods would run on desktop via IIS which would host WS. To create them, please click ‘Create/Web Site’ and choose "ASP.Net Web Service". You'll get project skeleton, simply add code you need and run it. Decorate added methods with WebMethod attribute. This is desktop project, so you could use anything desktop has to offer.

Calling WS from device pretty much looks like a normal function call. All necessary code would be created for you automatically as soon as you add Web Reference to your project.

|||i want to connecting Access database on PDA ?
i am setting Access database on PDA..
can i do ?
and how i doing?|||How would one connect to an access database inside the web method?
|||

while the .NET Compact Framework has no APIs to leverage Access databases, there is an open source set of APIs that support Access at www.opennetcf.org

there are also some commercial libraries available - use Google Advanced Groups search on microsoft.public.dotnet.framework.compactframework and look for "Access Database"

Darren

Sunday, March 25, 2012

Access database connection

I am running Visual Studios 2005 enterprise edition and I am creating a mobile application to keep track of some receipts. The problem I'm currently having is that even though I can connect to the MS Access Database with Server Explorer that I'll be aquiring data from; Everytime I attempt to use the Data Configuration Wizard to add a new data source that namely the database I get this error message:

The new connection uses a data provider that is not supported. (end of message)

There is no username or password necessary to access this database and it is an Access 2003 database.

Any help would be greatly appreciated.

Just to make sure...

You did change the Data Source to:

Microsoft Access Database File (OLE DB)

Which will use the following .NET Data Provider:

.NET Framework Data Provider for OLE DB

I assume you did in order to select the database, but I just want to make sure.

And when you click the button "Test Connection", it gives you that error?

Regards,

Dave

|||

Well that is the default settings so I just left those as they were and once I had figured out how to connect to the database thru server explorer, whenever I hit the test connection it said Connection ok. However the error message pops up when I attempt to add the database thru the add new datasource wizard.


|||Perhaps I'm missing something, but didn't you say this was a mobile app? Isn't the reason that VS is refusing to use the data source simply because the JET database engine doesn't run on mobile devices? -- Brendan Reynolds Access MVP wrote in message news:b986531d-b456-4194-af38-649f7db26f0d@.discussions.microsoft.com... >I am running Visual Studios 2005 enterprise edition and I am creating a
> mobile application to keep track of some receipts. The problem I'm
> currently having is that even though I can connect to the MS Access
> Database with Server Explorer that I'll be aquiring data from; Everytime
> I attempt to use the Data Configuration Wizard to add a new data source
> that namely the database I get this error message: >
> The new connection uses a data provider that is not supported. (end of
> message) >
> There is no username or password necessary to access this database and
> it is an Access 2003 database. >
> Any help would be greatly appreciated. >
>|||

To: Mr. Reynolds
I have no idea sir, I started the project as a smart device app, and in all the walkthroughs I have viewed nothing has been said about the Jet database engine being incompatible with mobile devices. If this is the case I'd like to know because this project is currently dependent on VS being able to connect with our Access database.


|||

I'm not sure of the limitations, you're best asking at the SQL Mobile Forum.

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=152&SiteID=1

Am moving this thread to there.

Here's some info on SQL Server 2005 Mobile Edition

http://msdn.microsoft.com/sql/mobile/default.aspx

Alex.

|||The JET database engine runs only on desktop and server versions of Windows. It's certainly possible to develop a mobile web app that talks to a JET database on the server, but if you need a local data store on the mobile device that will remain available when the device is not connected to the network, then you will not be able to use JET. Your alternatives - as I understand it - include SQL Server CE and XML. There is a database engine on the Pocket PC called 'Pocket Access' but it has very little to do with the desktop product, and there is no built-in support for 'Pocket Access' in the .NET framework. There is, however, a third-party component you could look at. There's an article on this at the URL below, and there's a link from the article to the vendor of the third-party component. Note that I haven't personally used this, and I don't know what plans, if any, Microsoft has to continue to support 'Pocket Access'. So this isn't a recommendation, just something that may be worth further investigation. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnroad/html/road10222003.asp There's an interesting article on 'Data Access Strategies for the Microsoft ..NET Compact Framework' at the following URL. Although the article dates back to the .NET 1.0 timeframe, I believe it is still relevant. http://msdn.microsoft.com/mobility/understanding/articles/default.aspx?pull=/library/en-us/dnnetcomp/html/dataaccessstrategy.asp -- Brendan Reynolds Access MVP wrote in message news:703e94a5-811d-4486-927c-34c62b34dc36_WBRev1_@.discussions.microsoft.com...
> This post has been edited either by the author or a moderator in the
> Microsoft Forums: http://forums.microsoft.com
> To: Mr. Reynolds
> I have no idea sir, I started the project as a smart device app, and in
> all the walkthroughs I have viewed nothing has been said about the Jet
> database engine being incompatible with mobile devices. If this is the
> case I'd like to know because this project is currently dependent on VS
> being able to connect with our Access database. > > > >
>|||Thank you for the information. Unfortunately I have a follow up question. If I were to make an intermediate SQL database to function as the go between for a SQL Mobile database and a Microsoft access database, is such a solution even possible? Our organization recently purchased VS 2005 on the assumption that it would be easy to use the .NET framework to develop a mobile app that would easily transfer data to an access database. Now with this new information its quite possible the data will go SQL Mobile -> SQL Database -> MS Access database.
Footnote:
The SQL Database would just function as a temporary store to check data generated from receipts made in the mobile database. Once the checks are done the corrected data would be passed to the MS Access database. Then the SQL database would wipe itself clean.
|||

Yes, but it makes no sense. To accomplish that you would have to purchase SQL 2000/2005 and pay CALs per device (or per CPU license). If that’s acceptable, simply get rid of Access and use much more powerful SQL you've paid for.

Alternative solution is to use Web Service to talk to Access database. Create couple WEB methods to talk to access and call them from device. Something like this should do:

DataSet GetAccessData(String command, …)

{

// Connect to Access DB here, execute command and populate data set with returned data.

return dataSet;

}

Bool UpdateAccessData(DataSet dataSet, … )

{

// Connect to Access DB here and update DB with data from Data Set.

return success;

}

|||To: Ilya
The enterprise edition that we purchased of VBS 2005 came with SQL server 2005 and I just installed it upon learning that I can't communicate directly with the Access database. I'm not sure if we still have to pay the CALS per device though.
If I used these web service methods where would I write them? In the upload and download portion of the code for the mobile app?
|||

I believe it comes with 5 CALs (to be verified).

These WS methods would run on desktop via IIS which would host WS. To create them, please click ‘Create/Web Site’ and choose "ASP.Net Web Service". You'll get project skeleton, simply add code you need and run it. Decorate added methods with WebMethod attribute. This is desktop project, so you could use anything desktop has to offer.

Calling WS from device pretty much looks like a normal function call. All necessary code would be created for you automatically as soon as you add Web Reference to your project.

|||i want to connecting Access database on PDA ?
i am setting Access database on PDA..
can i do ?
and how i doing?|||How would one connect to an access database inside the web method?
|||

while the .NET Compact Framework has no APIs to leverage Access databases, there is an open source set of APIs that support Access at www.opennetcf.org

there are also some commercial libraries available - use Google Advanced Groups search on microsoft.public.dotnet.framework.compactframework and look for "Access Database"

Darren

Friday, February 24, 2012

About SQL Mobile Server

I need to export(import) data from Pocket PC(SQL Mobile Server) to SQl Server 2005(central data storage) in real time, if anyone knows how it would be better and faster to do...Maybe someone have done something like this...

Sorry for my English, I use it at first for last 6 years...)))

What's "real time" in your case? Also, since you have to have connection at all times for "real time" synchronization, why could not you use SQL Client to talk to SQL Server 2005 directly?

|||Do you have wireless connection between the central database and pocket pc?
|||

Sorry that I didn't answer erlear but for my headake list of my problems is very big...and know I hate peoples who write viruses .....

You See SQL Client...it's not best idea, cause I will have dial-up connect from Pocket PC to central DataBase (6-10GB) and I dont need to see it all..only several tables...and can upgrade them if it need..So I think that it better to make programm which will work with SQL Mobile Server..and then connect to central SQL Server and upgrade it...So I have a question...how it would be better to do...the component which syncronize databases don't work(it's writes that she need .net framework v 2.0.50727 or something like this i have installed .net framework...and so i don't know what is she want from me) It's my first expeerence in programming for Pocket PC, so something that is seem very easy for you for me is not...Sorry for my English...If you know russian it's would be easer for me to tell you what I need thank's!

|||

He says he is using dial-up to connect the Pocket PC with the server. So it would make the most sense to me to store everything he needs locally and only once in a while make a connection to the server to synchronize stuff (RDA or merge).

About that Framework message you get; apart from .NET CF2 did you install SQL Client 2.0 and SQL Server Mobile 2005 on your Pocket PC?

|||

I'll connect them throw Internet...

Thank's.

Sorry for my English.

|||

I think same...

I install full SQL 2005 Server and Mobile Server with native Client..So also think that if i synchronize databaseses they will updates once when connected if it needed.....

Sorry for my english...it's auful I know...

Thank's

|||

Tom v E wrote:

About that Framework message you get; apart from .NET CF2 did you install SQL Client 2.0 and SQL Server Mobile 2005 on your Pocket PC?

Now I dont use now real Pocket PC and this is the biggest problem..I emulate Pocket PC and Pocket OS.

|||

Hi,

SqlClient Vs SqlServerCe

SqlClient does not create any local database (that is SQL Mobile DB)

SqlServerCe would create a local database.

I recommend you to go through Merge Replication and RDA topics in our books online in detail to have a better understanding on how to get your job done.

Thanks

Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Everywhere, Microsoft Corporation

About SQL Mobile Server

I need to export(import) data from Pocket PC(SQL Mobile Server) to SQl Server 2005(central data storage) in real time, if anyone knows how it would be better and faster to do...Maybe someone have done something like this...

Sorry for my English, I use it at first for last 6 years...)))

What's "real time" in your case? Also, since you have to have connection at all times for "real time" synchronization, why could not you use SQL Client to talk to SQL Server 2005 directly?

|||Do you have wireless connection between the central database and pocket pc?
|||

Sorry that I didn't answer erlear but for my headake list of my problems is very big...and know I hate peoples who write viruses .....

You See SQL Client...it's not best idea, cause I will have dial-up connect from Pocket PC to central DataBase (6-10GB) and I dont need to see it all..only several tables...and can upgrade them if it need..So I think that it better to make programm which will work with SQL Mobile Server..and then connect to central SQL Server and upgrade it...So I have a question...how it would be better to do...the component which syncronize databases don't work(it's writes that she need .net framework v 2.0.50727 or something like this i have installed .net framework...and so i don't know what is she want from me) It's my first expeerence in programming for Pocket PC, so something that is seem very easy for you for me is not...Sorry for my English...If you know russian it's would be easer for me to tell you what I need thank's!

|||

He says he is using dial-up to connect the Pocket PC with the server. So it would make the most sense to me to store everything he needs locally and only once in a while make a connection to the server to synchronize stuff (RDA or merge).

About that Framework message you get; apart from .NET CF2 did you install SQL Client 2.0 and SQL Server Mobile 2005 on your Pocket PC?

|||

I'll connect them throw Internet...

Thank's.

Sorry for my English.

|||

I think same...

I install full SQL 2005 Server and Mobile Server with native Client..So also think that if i synchronize databaseses they will updates once when connected if it needed.....

Sorry for my english...it's auful I know...

Thank's

|||

Tom v E wrote:

About that Framework message you get; apart from .NET CF2 did you install SQL Client 2.0 and SQL Server Mobile 2005 on your Pocket PC?

Now I dont use now real Pocket PC and this is the biggest problem..I emulate Pocket PC and Pocket OS.

|||

Hi,

SqlClient Vs SqlServerCe

SqlClient does not create any local database (that is SQL Mobile DB)

SqlServerCe would create a local database.

I recommend you to go through Merge Replication and RDA topics in our books online in detail to have a better understanding on how to get your job done.

Thanks

Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Everywhere, Microsoft Corporation

Thursday, February 16, 2012

About PlatformNotSupportedException in WM 5.0 with SQL Server

Hi All, I am now trying to develop an application connecting to a remote SQL server in a PDA with Windows Mobile 5.0 in Visual Studio.

I have installed SDK for WM5.0 for the development.

But I got the following Exception

System.PlatformNotSupportedException was unhandled
Message="PlatformNotSupportedException"
StackTrace:
at System.Globalization.CultureInfo..ctor()
at System.Globalization.CultureInfo..ctor()
at System.Data.SqlClient.TdsParser.GetCodePage()
at System.Data.SqlClient.TdsParser.ProcessEnvChange()
at System.Data.SqlClient.TdsParser.Run()
at System.Data.SqlClient.TdsParser.Run()
at System.Data.SqlClient.SqlInternalConnection.Login()
at System.Data.SqlClient.SqlInternalConnection.OpenAndLogin()
at System.Data.SqlClient.SqlInternalConnection..ctor()
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen()
at System.Data.Common.DbDataAdapter.FillInternal()
at System.Data.Common.DbDataAdapter.Fill()
at System.Data.Common.DbDataAdapter.Fill()
at DeviceApplication1.rfidcpsDataSetTableAdapters.VehicleTableAdapter.Fill()
at DeviceApplication1.Form1.Form1_Load()
at System.Windows.Forms.Form.OnLoad()
at System.Windows.Forms.Form._SetVisibleNotify()
at System.Windows.Forms.Control.set_Visible()
at System.Windows.Forms.Application.Run()
at DeviceApplication1.Form1.Main()

I just cannot figure what's the problem. Please help me! Thanks a lot!

That means you're trying to use locale which is not supported on your device (or emulator). With SQL Client it happens if your database has collation which is not available on device.

How to fix it:

1. Get device/emulator which supports collation you're using in your database (best way to go). Usually that would be device localized in particular language.

2. Purchase and install localization package on to your device. Note: some of these packages are do not provide complete localization required by NETCF and might not work, so test before you buy.

3. Change database collation to whatever is supported on your device. This one has consequences of potentially incorrect sorting, etc. Please refer to SQL Server documentation for collation impact.

|||

Thanks. Actually my database is just in English and no other language.

So I go for changing database collation. But in the Option, I don't know which one is supported in my PDA (Dell Axim X51v). In the PDA with WM 5.0, the regional setting is to English(United States). In th SQL Server Database collation, it was set to Chinese_Hong_Kong_Stroke_90_CI_AI_WS.

Can you tell me which collation I should set to as well as the locale setting in the PDA?

Thanks a lots!

|||

If your device is in English then I would guess something like SQL_Latin1_General* in it would do.

|||

I tried to change the database collation to "SQL_Latin1_General_CP1_CI_AI", with PDA setting to English(United States), but the same error came out!

Here comes my code and error

Dim sqlConnection1 As New SqlConnection("Data Source=BILLY\SQLEXPRESS;Initial Catalog=rfidcps;Persist Security Info=True;User ID=*****; Password=****;")

Dim cmd As New SqlCommand

Dim reader As SqlDataReader

cmd.CommandText = "SELECT * FROM Vehicle WHERE MainTagID = '123''"

Dim i As Integer = 0

cmd.CommandType = CommandType.Text

cmd.Connection = sqlConnection1

sqlConnection1.Open()

reader = cmd.ExecuteReader()

--

ERROR

System.PlatformNotSupportedException was unhandled
Message="PlatformNotSupportedException"
StackTrace:
at System.Globalization.CultureInfo..ctor()
at System.Globalization.CultureInfo..ctor()
at System.Data.SqlClient.TdsParser.GetCodePage()
at System.Data.SqlClient.TdsParser.ProcessMetaData()
at System.Data.SqlClient.TdsParser.Run()
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at RFIDApp.Form1.Form1_Load()
at System.Windows.Forms.Form.OnLoad()
at System.Windows.Forms.Form._SetVisibleNotify()
at System.Windows.Forms.Control.set_Visible()
at System.Windows.Forms.Application.Run()
at RFIDApp.Form1.Main()

Can any one help me?

|||

Use debugger to see which locale/LCID it's trying to use. Try another collation.

I'm also quite surprised you can even connect to the server - named instances do not work with devices because there's no support for named pipes. Are you running another SQL Server by any chance? Since you obviously can connect I would suspect this connection is made to the wrong server and you're changing collations not on the database you're connecting to. See this for more info on SQL Express connections from NETCF.

|||

"Use debugger to see which locale/LCID it's trying to use."

-> How can I check it?

Actually I did try to use the emulator to run but I failed to run and showed some error. So I stopped to carry on.

Ha, I don't know why, but, I can sure that my computer has only one instance of SQL Server (SQL Server Express Edition). So, the collation setting is the right one I used.

Any other advice? Thanks a lot!

|||

In the Debug/Exceptions... menu check the "Thrown" box for CLR exception. Run to the right exception and look at call stack window, you'll see something like this on the top:

mscorlib.dll!System.Globalization.CultureTableRecord.GetCultureTableRecord(int cultureId = 4556, bool useUserOverride = true) + 0x3c bytes

First number is a culture ID it's trying to get, should be 1033 for ENU. It would be something else in your case, look up which culture is that on MSDN.

Have you tried localized emulator, e.g. in CHT?

Try following the tutorial. Try changing collation for entire SQL Server Express.

|||

Thanks. I've used your method to check the cultureID. The conclusion is that it is set to 0xC04 Chinese (Hong Kong SAR, PRC)

I think it is the problem!! But how can I really change it to other value? How to chang this ID to ENGLISH?

Thanks a lot for your help!

|||

You already know that – you need to change database collation. It’s pretty clear what your attempt to change it has failed and you’re still using Chinese_Hong_Kong_Stroke_90_CI_AI_WS so client if forced to create matching locale (Chinese (Hong Kong SAR, PRC)) which is failing because your device does not support it.

I don’t know why it did not work, I would suggest asking in SQL Express forum. Perhaps SQL Express only allows one collation per server or something…

Also try creating brand new database with some ENU collation, see if that works.

|||

Yes, I finally understand the problem.

But what makes trouble is that I DID reinstall the SQL server express for changing the collation at server-level to Latin1_General_CI_AI,

Also, I DID change the database collation to Latin1_General_CI_AI as well! But how come from the debugger, the locale is Chinese (Hong Kong SAR, PRC)!!!!!!!

I have double-checked the setting in SQL Server Managment Studio Express! I tried to restart my computer as well but there's no change!!

Feel so lost!

|||I'm with Ilya on this one, please post this question in the SQL Server forum|||Thanks all of you. Hope someone could help me. :)