sidNic
asked on
sql server 2000 Database access from pocket pc
I'm currently evaluating whether to develop a stock control system using pocket pc 2002
i've downloaded embedded visual basic to develop this with. At present i'm only using an emulator.
I'm trying to connect to a sql server 2000 database on our main server.
The pda would be on a wireless network so it should be able to connect direct to the database.
Is it possible to talk directly to sql server? I've seen many posts which just relate to sql server ce which i dont think is suitable.
does anyone have an example of how to connect using adoce to the db? the connection string i use on our normal vb apps doesnt work.
i've downloaded embedded visual basic to develop this with. At present i'm only using an emulator.
I'm trying to connect to a sql server 2000 database on our main server.
The pda would be on a wireless network so it should be able to connect direct to the database.
Is it possible to talk directly to sql server? I've seen many posts which just relate to sql server ce which i dont think is suitable.
does anyone have an example of how to connect using adoce to the db? the connection string i use on our normal vb apps doesnt work.
Hi,
yes its possible, you have to use RDA. Try use the source bellow, i use it on my Project and works well.
ISSCERDA* CERDA;
WCHAR wszConnectString[512]; // Persists the RDAConnectionString
WCHAR wszLocalTable[255]; // Persists the RDALocalTable
WCHAR wszErrorTable[255]; // Persists the RDAErrorTable
BSTR wszQuery;
HRESULT hr;
CLSID tClsid;
hr = CLSIDFromProgID( _T("SSCE.RemoteDataAccess. 2.0"), &tClsid );
if (FAILED(hr))
return false;
hr = CoCreateInstance(
tClsid, // CLSID_RemoteDataAccess
NULL,
CLSCTX_INPROC_SERVER,
IID_ISSCERDA,
(LPVOID *)&CERDA);
if(FAILED(hr)) return false;
hr = CERDA->put_InternetURL(L"http://host/sqlremote/sscesa20.dll" );
if(FAILED(hr)) return false;
hr = CERDA->put_InternetLogin(L "host\\use r");
if(FAILED(hr)) return false;
hr = CERDA->put_InternetPasswor d(L"----") ;
if(FAILED(hr)) return false;
hr = CERDA->put_LocalConnection String( L"Provider=Microsoft.SQLSE RVER.OLEDB .CE.2.0;Da ta Source=\\db.sdf" );
if(FAILED(hr)) return false;
wcscpy(wszConnectString, L"Provider=sqloledb;Initia l Catalog=dbname;Data Source=host;UID=sqlUser;pa ssword=pwd ");
wcscpy(wszErrorTable, L"ErrorTable");
CString csQuery = L"Select * from table";
wszQuery = csQuery.AllocSysString();
wcscpy(wszLocalTable, TABLE_NAME);
hr = CERDA->Pull(wszLocalTable, wszQuery, wszConnectString, TRACKINGOFF, wszErrorTable);
if(FAILED(hr) return false;
Daniel Junges
yes its possible, you have to use RDA. Try use the source bellow, i use it on my Project and works well.
ISSCERDA* CERDA;
WCHAR wszConnectString[512]; // Persists the RDAConnectionString
WCHAR wszLocalTable[255]; // Persists the RDALocalTable
WCHAR wszErrorTable[255]; // Persists the RDAErrorTable
BSTR wszQuery;
HRESULT hr;
CLSID tClsid;
hr = CLSIDFromProgID( _T("SSCE.RemoteDataAccess.
if (FAILED(hr))
return false;
hr = CoCreateInstance(
tClsid, // CLSID_RemoteDataAccess
NULL,
CLSCTX_INPROC_SERVER,
IID_ISSCERDA,
(LPVOID *)&CERDA);
if(FAILED(hr)) return false;
hr = CERDA->put_InternetURL(L"http://host/sqlremote/sscesa20.dll"
if(FAILED(hr)) return false;
hr = CERDA->put_InternetLogin(L
if(FAILED(hr)) return false;
hr = CERDA->put_InternetPasswor
if(FAILED(hr)) return false;
hr = CERDA->put_LocalConnection
if(FAILED(hr)) return false;
wcscpy(wszConnectString, L"Provider=sqloledb;Initia
wcscpy(wszErrorTable, L"ErrorTable");
CString csQuery = L"Select * from table";
wszQuery = csQuery.AllocSysString();
wcscpy(wszLocalTable, TABLE_NAME);
hr = CERDA->Pull(wszLocalTable,
if(FAILED(hr) return false;
Daniel Junges
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hello Tim,
I'm trying to do the same thing with my WiFi Palm. Do you mind showing me your sample code?
Your help would be greatly appreciated.
Thanks
Norm Nguyen
I'm trying to do the same thing with my WiFi Palm. Do you mind showing me your sample code?
Your help would be greatly appreciated.
Thanks
Norm Nguyen
You guys are making it too comlicated, just use a webservice.
Did you already try the VB Sample DatabaseViewer??
Cheers,
Prakash