PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
connect to my cdb file...
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
connect to my cdb file...
![]() |
connect to my cdb file... |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hello,
I have a cdb file called data.cdb stored into my PocketPC. Below is my code, I am using msgbox for debugging purpose: ' Here we I do all the necessary coding to display the contents in Dim strHandHeld As String = TheReaderData.Text Dim Conn As New SqlConnection("User ID=DSUSER;PASSWORD=silentk;Data Source=NTSERVER-2;Initial Catalog=Direct Source System;Persist Security Info=False;Packet Size=4096") Dim objDataReader As SqlDataReader = Nothing Dim myCommand As New SqlCommand() Dim strSQL As String = "SELECT Item_Number FROM Product WHERE UPC = '" & Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld, 2, 5) & " " & Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1) & "'" txtUPC.Text = Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld, 2, 5) & " " & Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1) Dim strLocation As String = "" MsgBox("1") Dim objSQLCeCommand As System.Data.SqlServerCe.SqlCeCommand = Nothing MsgBox("2") Dim objSQLCeConnection As New System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb") MsgBox("3") Dim objSQLCeDataReader As System.Data.SqlServerCe.SqlCeDataReader = Nothing MsgBox("4") objSQLCeConnection.Open() MsgBox("5") objSQLCeCommand = New System.Data.SqlServerCe.SqlCeCommand(strSQL, objSQLCeConnection) MsgBox("6: " & strSQL) objSQLCeDataReader = objSQLCeCommand.ExecuteReader MsgBox("7: " & objSQLCeCommand.ExecuteReader.Read) MsgBox(objSQLCeDataReader("Item_Number")) MsgBox("8") objSQLCeConnection.Close() MsgBox("9") MsgBox("Arrived safely") Anyways as soon as the line hits for number 4 it refuses to open the connection...this is how I am connecting to my data.cdb: Dim objSQLCeConnection As New System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb") is this wrong? If so how do I connect to my .cdb file in my PocketPC? Thanks, appreciate it big time. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
CDB files are not SQL CE files, so the SqlCE classes cannot open them. CDBs
are a deprecated Pocket Access format and there are no built-in managed libraries for talking to them. InTheHand does have a commercial solution that works well. -- Chris Tacke OpenNETCF Consulting Managed Code in the Embedded World www.opennetcf.com -- <amiga500@gmail.com> wrote in message news:1165337765.591611.23050@80g2000cwy.googlegroups.com... > Hello, > > I have a cdb file called data.cdb stored into my PocketPC. Below is my > code, I am using msgbox for debugging purpose: > > ' Here we I do all the necessary coding to display the contents in > Dim strHandHeld As String = TheReaderData.Text > Dim Conn As New SqlConnection("User > ID=DSUSER;PASSWORD=silentk;Data Source=NTSERVER-2;Initial > Catalog=Direct Source System;Persist Security Info=False;Packet > Size=4096") > Dim objDataReader As SqlDataReader = Nothing > Dim myCommand As New SqlCommand() > Dim strSQL As String = "SELECT Item_Number FROM Product WHERE > UPC = '" & Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld, 2, 5) & " " > & Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1) & "'" > txtUPC.Text = Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld, > 2, 5) & " " & Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1) > Dim strLocation As String = "" > MsgBox("1") > Dim objSQLCeCommand As System.Data.SqlServerCe.SqlCeCommand = > Nothing > MsgBox("2") > Dim objSQLCeConnection As New > System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb") > MsgBox("3") > Dim objSQLCeDataReader As > System.Data.SqlServerCe.SqlCeDataReader = Nothing > MsgBox("4") > objSQLCeConnection.Open() > MsgBox("5") > objSQLCeCommand = New > System.Data.SqlServerCe.SqlCeCommand(strSQL, objSQLCeConnection) > MsgBox("6: " & strSQL) > objSQLCeDataReader = objSQLCeCommand.ExecuteReader > MsgBox("7: " & objSQLCeCommand.ExecuteReader.Read) > MsgBox(objSQLCeDataReader("Item_Number")) > MsgBox("8") > objSQLCeConnection.Close() > MsgBox("9") > MsgBox("Arrived safely") > > Anyways as soon as the line hits for number 4 it refuses to open the > connection...this is how I am connecting to my data.cdb: > > Dim objSQLCeConnection As New > System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb") > > is this wrong? If so how do I connect to my .cdb file in my PocketPC? > Thanks, appreciate it big time. > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Are you telling me there are absolutely no alternative what so ever but
to get a third party program to do this? On Dec 5, 12:01 pm, "<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote: > CDB files are not SQL CE files, so the SqlCE classes cannot open them. CDBs > are a deprecated Pocket Access format and there are no built-in managed > libraries for talking to them. InTheHand does have a commercial solution > that works well. > > -- > Chris Tacke > OpenNETCF Consulting > Managed Code in the Embedded Worldwww.opennetcf.com > -- > > <amiga...@gmail.com> wrote in messagenews:1165337765.591611.23050@80g2000cwy.googlegroups.com... > > > Hello, > > > I have a cdb file called data.cdb stored into my PocketPC. Below is my > > code, I am using msgbox for debugging purpose: > > > ' Here we I do all the necessary coding to display the contents in > > Dim strHandHeld As String = TheReaderData.Text > > Dim Conn As New SqlConnection("User > > ID=DSUSER;PASSWORD=silentk;Data Source=NTSERVER-2;Initial > > Catalog=Direct Source System;Persist Security Info=False;Packet > > Size=4096") > > Dim objDataReader As SqlDataReader = Nothing > > Dim myCommand As New SqlCommand() > > Dim strSQL As String = "SELECT Item_Number FROM Product WHERE > > UPC = '" & Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld, 2, 5) & " " > > & Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1) & "'" > > txtUPC.Text = Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld, > > 2, 5) & " " & Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1) > > Dim strLocation As String = "" > > MsgBox("1") > > Dim objSQLCeCommand As System.Data.SqlServerCe.SqlCeCommand = > > Nothing > > MsgBox("2") > > Dim objSQLCeConnection As New > > System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb") > > MsgBox("3") > > Dim objSQLCeDataReader As > > System.Data.SqlServerCe.SqlCeDataReader = Nothing > > MsgBox("4") > > objSQLCeConnection.Open() > > MsgBox("5") > > objSQLCeCommand = New > > System.Data.SqlServerCe.SqlCeCommand(strSQL, objSQLCeConnection) > > MsgBox("6: " & strSQL) > > objSQLCeDataReader = objSQLCeCommand.ExecuteReader > > MsgBox("7: " & objSQLCeCommand.ExecuteReader.Read) > > MsgBox(objSQLCeDataReader("Item_Number")) > > MsgBox("8") > > objSQLCeConnection.Close() > > MsgBox("9") > > MsgBox("Arrived safely") > > > Anyways as soon as the line hits for number 4 it refuses to open the > > connection...this is how I am connecting to my data.cdb: > > > Dim objSQLCeConnection As New > > System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb") > > > is this wrong? If so how do I connect to my .cdb file in my PocketPC? > > Thanks, appreciate it big time. |
|
|
|
#4 |
|
Guest
Posts: n/a
|
There's always some alternative, but not necessarily a practical one. You
could wrap the deprecated API yourself. Paul T. <amiga500@gmail.com> wrote in message news:1165338880.976222.107970@79g2000cws.googlegroups.com... > Are you telling me there are absolutely no alternative what so ever but > to get a third party program to do this? > > On Dec 5, 12:01 pm, "<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote: >> CDB files are not SQL CE files, so the SqlCE classes cannot open them. >> CDBs >> are a deprecated Pocket Access format and there are no built-in managed >> libraries for talking to them. InTheHand does have a commercial solution >> that works well. >> >> -- >> Chris Tacke >> OpenNETCF Consulting >> Managed Code in the Embedded Worldwww.opennetcf.com >> -- >> >> <amiga...@gmail.com> wrote in >> messagenews:1165337765.591611.23050@80g2000cwy.googlegroups.com... >> >> > Hello, >> >> > I have a cdb file called data.cdb stored into my PocketPC. Below is my >> > code, I am using msgbox for debugging purpose: >> >> > ' Here we I do all the necessary coding to display the contents in >> > Dim strHandHeld As String = TheReaderData.Text >> > Dim Conn As New SqlConnection("User >> > ID=DSUSER;PASSWORD=silentk;Data Source=NTSERVER-2;Initial >> > Catalog=Direct Source System;Persist Security Info=False;Packet >> > Size=4096") >> > Dim objDataReader As SqlDataReader = Nothing >> > Dim myCommand As New SqlCommand() >> > Dim strSQL As String = "SELECT Item_Number FROM Product WHERE >> > UPC = '" & Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld, 2, 5) & " " >> > & Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1) & "'" >> > txtUPC.Text = Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld, >> > 2, 5) & " " & Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1) >> > Dim strLocation As String = "" >> > MsgBox("1") >> > Dim objSQLCeCommand As System.Data.SqlServerCe.SqlCeCommand = >> > Nothing >> > MsgBox("2") >> > Dim objSQLCeConnection As New >> > System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb") >> > MsgBox("3") >> > Dim objSQLCeDataReader As >> > System.Data.SqlServerCe.SqlCeDataReader = Nothing >> > MsgBox("4") >> > objSQLCeConnection.Open() >> > MsgBox("5") >> > objSQLCeCommand = New >> > System.Data.SqlServerCe.SqlCeCommand(strSQL, objSQLCeConnection) >> > MsgBox("6: " & strSQL) >> > objSQLCeDataReader = objSQLCeCommand.ExecuteReader >> > MsgBox("7: " & objSQLCeCommand.ExecuteReader.Read) >> > MsgBox(objSQLCeDataReader("Item_Number")) >> > MsgBox("8") >> > objSQLCeConnection.Close() >> > MsgBox("9") >> > MsgBox("Arrived safely") >> >> > Anyways as soon as the line hits for number 4 it refuses to open the >> > connection...this is how I am connecting to my data.cdb: >> >> > Dim objSQLCeConnection As New >> > System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb") >> >> > is this wrong? If so how do I connect to my .cdb file in my PocketPC? >> > Thanks, appreciate it big time. > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
No. If it *must* be a CDB then you have 2 options:
1. Use a third-party library 2. Write your own library P/Invoking the system APIs to talk to the CDB. #2 is a lot of work, which is why the 3rd party libraries exist in the first place. If the CDB is not a requirement, then you could use a number of other better supported database formats, like SQL CE/Mobile/Everywhere/Anywhere or MySQL. -- Chris Tacke OpenNETCF Consulting Managed Code in the Embedded World www.opennetcf.com -- <amiga500@gmail.com> wrote in message news:1165338880.976222.107970@79g2000cws.googlegroups.com... > Are you telling me there are absolutely no alternative what so ever but > to get a third party program to do this? > > On Dec 5, 12:01 pm, "<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote: >> CDB files are not SQL CE files, so the SqlCE classes cannot open them. >> CDBs >> are a deprecated Pocket Access format and there are no built-in managed >> libraries for talking to them. InTheHand does have a commercial solution >> that works well. >> >> -- >> Chris Tacke >> OpenNETCF Consulting >> Managed Code in the Embedded Worldwww.opennetcf.com >> -- >> >> <amiga...@gmail.com> wrote in >> messagenews:1165337765.591611.23050@80g2000cwy.googlegroups.com... >> >> > Hello, >> >> > I have a cdb file called data.cdb stored into my PocketPC. Below is my >> > code, I am using msgbox for debugging purpose: >> >> > ' Here we I do all the necessary coding to display the contents in >> > Dim strHandHeld As String = TheReaderData.Text >> > Dim Conn As New SqlConnection("User >> > ID=DSUSER;PASSWORD=silentk;Data Source=NTSERVER-2;Initial >> > Catalog=Direct Source System;Persist Security Info=False;Packet >> > Size=4096") >> > Dim objDataReader As SqlDataReader = Nothing >> > Dim myCommand As New SqlCommand() >> > Dim strSQL As String = "SELECT Item_Number FROM Product WHERE >> > UPC = '" & Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld, 2, 5) & " " >> > & Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1) & "'" >> > txtUPC.Text = Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld, >> > 2, 5) & " " & Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1) >> > Dim strLocation As String = "" >> > MsgBox("1") >> > Dim objSQLCeCommand As System.Data.SqlServerCe.SqlCeCommand = >> > Nothing >> > MsgBox("2") >> > Dim objSQLCeConnection As New >> > System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb") >> > MsgBox("3") >> > Dim objSQLCeDataReader As >> > System.Data.SqlServerCe.SqlCeDataReader = Nothing >> > MsgBox("4") >> > objSQLCeConnection.Open() >> > MsgBox("5") >> > objSQLCeCommand = New >> > System.Data.SqlServerCe.SqlCeCommand(strSQL, objSQLCeConnection) >> > MsgBox("6: " & strSQL) >> > objSQLCeDataReader = objSQLCeCommand.ExecuteReader >> > MsgBox("7: " & objSQLCeCommand.ExecuteReader.Read) >> > MsgBox(objSQLCeDataReader("Item_Number")) >> > MsgBox("8") >> > objSQLCeConnection.Close() >> > MsgBox("9") >> > MsgBox("Arrived safely") >> >> > Anyways as soon as the line hits for number 4 it refuses to open the >> > connection...this is how I am connecting to my data.cdb: >> >> > Dim objSQLCeConnection As New >> > System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb") >> >> > is this wrong? If so how do I connect to my .cdb file in my PocketPC? >> > Thanks, appreciate it big time. > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

