Click here to Skip to main content
Click here to Skip to main content

Accessing MS SQL Server CE v1.0/v2.0 without ADO

By , 2 Mar 2003
 

Introduction

I'm sure for those who are going to implement or already implemented MS SQL Server CE v1.0/2.0 have used the free tool (isqlw_wce.exe) from Microsoft and always have a big question mark in the mind about how to write such an application right?

So, this might be the right article for those who intend to find out more about this. At the end of this article, you will manage to access the MS SQL Server CE database which you have installed in your PocketPC device with your own valuable information and made your application more powerful and towards the enterprise level. :)

Why do we need MS SQL Server CE as compared to CD database? Because MS SQL Server CE offers a better performance and supports the SQL DDM/DDL that we are all familiar all the time. Which means, it will speed up our application/product development cycle.

Background

A minimum knowledge of SQL DDM and DDL is a must in order to utilize the various ready made functions. Because you require to write your own SQL statement to create your table, add/update/delete records from any table.

Using the code

Before you start looking at the code, you need to remember that MS SQL Server CE only supports single connection to any database at anytime.

When you look into the SqlSvrCE.cpp/.h you will get all the ready made functions that you eventually will call from your own WIN32API or MFC application and that is up to your choice.

Before you start downloading the sample code, let's have a look on what function you can have in this free source.

// Create a new SQL Server CE database provider.
HRESULT CreateSqlSvrCeProvider  (void);

// Create a new SQL Server CE database session right
// after successful connect to the pass in database
// name (*.sdf) in fullpath.
HRESULT CreateDBSession      (void);

// Retrieve the last known OLE DB error message, due to
// error occur through out the database access process.
HRESULT GetErrorMessage (LPTSTR lpszBuffer, int MaxBuffer);

// Connect the SQL Server CE database with reference to
// the pass in database name (*.sdf) in fullpath.
HRESULT  ConnectDB      (LPTSTR lpszDBName);

// Disconnect from the current open SQL Server CE database
// with reference to the pass in database name (*.sdf) in
// fullpath under the CreateDB/ConnectDB function.
HRESULT DisconnectDB      (LPTSTR lpszDBName);

// Create the SQL Server CE database with reference to
// the pass in database name (*.sdf) in fullpath.
HRESULT  CreateDB      (LPTSTR lpszDBName);

// Delete the SQL Server CE database with reference to
// the pass in database name (*.sdf) in fullpath.
HRESULT DeleteDB      (LPTSTR lpszDBName);

// Compact the SQL Server CE database with reference to
// the pass in database name (*.sdf) in fullpath.
HRESULT CompactDB      (LPTSTR lpszDBName);

// Create new table with reference to
// the pass in table name and first column information
// DUE TO SQL SERVER CE 2.0 MUST HAVE AT LEAST 1
// COLUMN IN THE CREATED TABLE.
HRESULT CreateTable      (LPTABLECOLUMNINFO lptci);

// Delete the existing table with reference to
// the pass in table name..
HRESULT DropTable      (LPTSTR lpszTableName);

// Create new column with reference to
// the pass in information in TABLECOLUMNINFO structure.
HRESULT CreateColumn (LPTABLECOLUMNINFO lptci);

// Drop the existing column with reference to
// the pass in information in TABLECOLUMNINFO structure.
HRESULT DropColumn (LPTABLECOLUMNINFO lptci);    

// Create new index with reference to
// the pass in information in TABLEINDEXINFO structure.
HRESULT CreateIndex (LPTABLEINDEXINFO lptii);

// Drop the existing index with reference to
// the pass in information in TABLEINDEXINFO structure.
HRESULT DropIndex  (LPTABLEINDEXINFO lptii);

// Execute the SQL Statement with does not require to
// return a RowSet object.
// EXAMPLE:
// SELECT, DELETE, CREATE TABLE, DROP TABLE, INSERT INTO & etc...
HRESULT ExecuteSQL      (LPTSTR lpszQuery);

// Load the records into a RowSet object with reference
// to the pass in SQL statement.
HRESULT  GetRowset      (LPTSTR lpszQuery);

// Process the Rowset object created by the GetRowset function.
HRESULT ProcessRowset      (IRowset *pRowset);

There is a total of eleven functions as shown above that you require to remember and call through out your database application.

But be aware that the ProcessRowset is fully customized to fit the attached sample application requirement, which will display all the retrieved records and column headers into the provided listview control. Therefore, you need to modify the ProcessRowset function or even write your own ProcessRowset function to interpret those data you have read from the MS SQL Server CE database.

All the necessary note is available in the source file and with this note, I'm sure it will make your life easy when you start to modify or write your own ProcessRowset function.

Therefore, to use the above function is pretty straight forward. All you need is just call the relevant function with the correct corresponding argument.

For instance, you wish to create a database in \Windows folder with the name as MyDb.sdf. All you need is just call the CreateDB as below:

_tcscpy(szDBName, TEXT("\\windows\\MyDb.sdf"));
hr = CreateDB(szDBName);
// Validation
if (!FAILED(hr))
    // Display result message text.
    MessageBox(hWnd, TEXT("Database successful created."), 
                                       TEXT("Infor"), MB_OK);
else
{
    // Get OLE DB error message
    GetErrorMessage(szErrMessage, wcslen(szErrMessage));
    //
    if (E_OUTOFMEMORY == hr)
    {
      // Compose result message
      wsprintf(szErrMessage,
         TEXT("(0x%x) Out of memory!"),
         hr);
    }

    // Display result message text.
    MessageBox(hWnd, szErrMessage, TEXT("Error"), 
                               MB_ICONSTOP | MB_OK);
}

You may notice that the sample program user interface will not fit in the MS PocktePC (240x320) screen. This is because the sample application is developed base on Windows CE .NET platform and all I did is just create a new PocketPC application and direct copy all the relevant cpp/h files. Hope you don't mind about that.

Last but not least, I wish you enjoy the sample code and hope it will help you in any one of your application development cycles.

Update

A total of 6 new functions is implemented based on the previous source file, and these 6 functions are:

  • CreateTable
  • DropTable
  • CreateColumn
  • DropColumn
  • CreateIndex
  • DropIndex

These 6 functions, will give you an easy way to manage your database with writing the complex SQL-92 command.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

hackzai
Web Developer
Malaysia Malaysia
Hackzai was graduated from Double-E, and being certified as MCSD (VS6) at spring 2003. But move forward with ASP.NET, VB.NET, C#, Silverlight, LINQ, XML

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Answer100% workin code for Sql Server CE [modified] Pinmembercodemobile31-Oct-08 19:39 
There are most post about CE.Net and Sql-Server CE at
http://developerassistant.blogspot.com/[^]
 
I am very thankfull to this http://developerassistant.blogspot.com/[^] website, which helped me lot in Development. Smile | :) Smile | :) Smile | :)
 
modified on Sunday, November 30, 2008 2:00 AM

Generalproblem insert value into sqlserver mobile edition PinmemberMember 438636515-Sep-08 23:59 
hi
 
can anybody help me im working on device appliction i am facing the problem to insert value into database problem is when i insert value from the emulator the insret code is working fine and return 1 in executenonquery() but when i select data from database then i dont found any data in it and when i insert data directly into database using query its inserted and also view in emulator wnen application is run.

i can not understand what is the problem so plz help me to solve this problem.

GeneralDisconnect problem.. Pinmemberenderkaradag7-Sep-08 2:23 
hi author and friends,
 
this code help me save lots of time, thanks hackzai
 
have anyone covered DisconnectDB problem in SqlSvrCe.cpp?
 
ConnectDB(L"MYDB.SDF");
//success..
DisconnectDB(L"MYDB.SDF);
//seems success (but not actually)
ConnectDB(L"MYDB.SDF");
//fail.. (even when u try to connect MYDB.SDF with query analyser, fails again)
 
SqlCe do not support more than one processes accessing a sdf file, so this is a fault of DisconnectDB
 
im connecting the database via remote api, so using a device side dll. everything ok except this problem (every thing ok, but can connect to the sdf just for once at each activesync session, only way to release that connection is disconnecting from activesync
 
something here keeps process connected to the sdf
 
have any idea??
 
thanks everyone
regards
 
Ender Karadag
QuestionCheck if table exists Pinmembersanjaybal4-Sep-08 2:49 
What i have to do to know whether a table exists or not.
Questionselect * from table_name where ColName='abc' Query fails. Pinmembersanjaybal4-Sep-08 2:48 
Hi,
While executing select * from table_name where ColName='abc' query, it returns error code 0x80040e14. ColName type is nText.
But if the data type of ColName is Numeric, the query executes successfully and gives correct rows. PLease let me know how can i solve this issue?
Thanks,
Sanjay
Generalerror in demo mysqlce.cpp Pinmembersubodh kumar8329-May-08 0:36 
hi
when i am compiling this demo(mysqlce.cpp)
then i am getting error like
Error 1 error LNK2005: "struct IDBInitialize * pIDBInitialize" (?pIDBInitialize@@3PAUIDBInitialize@@A) already defined in MySqlCe.obj SqlSvrCe.obj
Error 2 error LNK2005: "struct IUnknown * pIUnknownSession" (?pIUnknownSession@@3PAUIUnknown@@A) already defined in MySqlCe.obj SqlSvrCe.obj
Error 3 error LNK2005: "struct IDBCreateSession * pIDBCreateSession" (?pIDBCreateSession@@3PAUIDBCreateSession@@A) already defined in MySqlCe.obj SqlSvrCe.obj
Error 4 error LNK2005: "struct IDBProperties * pIDBProperties" (?pIDBProperties@@3PAUIDBProperties@@A) already defined in MySqlCe.obj SqlSvrCe.obj
Error 5 error LNK2005: "struct IDBCreateCommand * pIDBCrtCmd" (?pIDBCrtCmd@@3PAUIDBCreateCommand@@A) already defined in MySqlCe.obj SqlSvrCe.obj
Error 6 error LNK2005: "struct ICommandText * pICmdText" (?pICmdText@@3PAUICommandText@@A) already defined in MySqlCe.obj SqlSvrCe.obj
Error 7 fatal error LNK1169: one or more multiply defined symbols found Pocket PC 2003
 
can anybody tell me where i am going wrong
 
thanx
Generalnot getting location of created database file Pinmembersubodh kumar8329-May-08 0:30 
Hi all
I am developing windows mobile 6.0 application using sql server compact edition in desktop.database file is created but it is not showing on my disk.someone told me it will store in emulator file system. but i am not able to access emulator file system
I am worried that whether it is create or not.
I have to insert data in table that is created in file and retrive data from table.
 
I am using OLE DB provider
so plz help me
 
thanx
QuestionHow to insert data into table......? Pinmemberstevenaustin368826-May-08 11:15 
Dear all
I am new to sql ce programming..beg ur pardon for asking stupid question....
after doing some searching..I finally can run the two demo project well...
but these two project can only create and drop table,column.....for me
and I had spent a lot of time trying to insert data into table....
I am wondering if there is anyone can show me a sample to teach me how to use
ExecuteSQL(),
what I am trying is
create table data,and create column ID,then the InsertExecutionLog function is like the following...
HRESULT InsertExecutionLog(CExecutionLog *execLog)
{
HRESULT hr = S_OK;
CString strSQL;
strSQL.Format(L"Insert Into data(ID) Values('%d')",execLog->SiteNo);
hr = ExecuteSQL((LPTSTR)(LPCTSTR)strSQL);
return hr;
}
can anyone tell me what's wrong with code.....
please ..and thanks in advance,especially for the author's effort.....
Questionprocess rowset Pinmembersivaturing9-Aug-07 15:34 
When I give random Search of 1000 records in particular db, the systems hangs after some 30 to 40 searches. Is there a Memory Problem. I use the Process Rowset function and retreived.
Generalproblem with creating the Database PinmemberLillian Bose8-Mar-07 19:33 
The code is compiled without errors but at the point of Database creation its throwing error "User Breakpoint called from code at 0x7c901230".
 
The error is thrown at the exection of the code :
hr = pIDBDataSourceAdmin->CreateDataSource(1,dbpropset,NULL,IID_IDBProperties, NULL);
 
Kindly provide with the solution to overcome the problem.
 
Thanks in advance.
 
Regards,
Bose.
GeneralConnecting SQL CE DB PinmemberLillian Bose6-Mar-07 22:24 
Dear All,
Im new to SQL CE DB.We are using SQl CE 2.0 version
I tried to connect the DB from my application which i developed in eVC++ 3.0 environment. For this i tried with the sample program provided by the MSDN in the following link
and the code
hr = CoCreateInstance(CLSID_SQLSERVERCE_2_0, NULL, CLSCTX_INPROC_SERVER,
IID_IDBDataSourceAdmin, (void**)(& pIDBDataSourceAdmin));
 
But return value is negative so i cant proceed further. Could any one of you help me in what went wrong.
 
Regards
Bose
GeneralRe: Connecting SQL CE DB Pinmembersubodh kumar8329-May-08 0:55 
GeneralThanks, man! Pinmembermwfolz20-Feb-07 16:17 
Your sample saved me a day of work for sure, hassling around with the "Nordwind OLEDB Sample Application". IOU.

 
Michael W. Folz
MWFolz S/C
Generalproblem with label1.Text = (string)objectRS.Fields[1].Value; Pinmemberadmin_vlad2-Feb-07 22:49 
Help please! Wy it causes exception in line
label1.Text = (string)objectRS.Fields[1].Value;
-------------------------------------------
Object one = new Object();
ADOCE.Connection objectConn = new ADOCE.Connection();
objectConn.Open("\\My documents\\db.cdb", "", "", 0);
 
string sSql = "SELECT sRus FROM Translator2 WHERE sEng = '" + textBox1.Text.ToString() + "'";
 
ADOCE.Recordset objectRS = new ADOCE.Recordset();
objectRS = objectConn.Execute(sSql, out one, 1);
while (objectRS.EOF != true)
{
label1.Text = (string)objectRS.Fields[1].Value;
objectRS.MoveNext();
}
-----------------------------------------------------------------------
Table: Translator2
Three columns: intID, sRus, sEng. Not null. For example:
1
Привет
Hello
 
Made in Access 2000 and converted in Pocket Access.
GeneralVS 2005 PinmemberAlexEvans29-Jan-07 14:10 
Hello
 
I and need some help to deploy this under VS 2005 - if this is possible at all...
 
Can you help me please?
 
Cheers
Alex

QuestionBinary Image update Pinmembermmm2221113-Nov-06 14:17 
hackzai great article.
 
Do you have an example of how to update a row's binary field?
 
Thanks.
QuestionHow creating a AuthPwd for a new Database? PinmemberRio118-Oct-06 4:34 
How can i create a AuthPwd for a new Database in code?
this should be implemented in CreateDB function.
AnswerRe: How creating a AuthPwd for a new Database? Pinmemberhackzai18-Oct-06 15:40 
GeneralRe: How creating a AuthPwd for a new Database? PinmemberRio119-Oct-06 4:25 
GeneralAccessing MS SQL Server CE v1.0/v2.0 without the ADO object. PinsussAnonymous14-Oct-05 3:10 
Hi
GeneralConnecting to my database Pinmemberdavidvargas21-Sep-05 23:36 
Hi:
 
I'm developing an sample application using this code to learn how SQL CE works. Now, I can create a database, execute SQL, etc. My application has a button that execute the follow code (the database exists):
 
ConnectDB(L"\\My Documents\\db.sdf");
 
ExecuteSQL(L"SELECT * FROM table");
 
DisconnectDB(L"\\My Documents\\db.sdf");
 
ShowInformation();
 
Only the first time I click the button it works OK. If I try another time ConnectDB fails. It seems Disconnect rutine doesn't work correctly.
 
Thanks in advance.
GeneralRe: Connecting to my database Pinmembersunny_2218-Apr-07 18:54 
Generalsql ce 2.0,ppc2003, init connection Pinmembercrozet20-Jul-05 10:01 
Hi, great works. It seems easier to use SQLserverCE.
 
I did all the fix for sqlce2.0 and ppc 2003;
I can compile my code, and execute it from the pocketpc.
The problem is when the program try to init a connection with the sql server ce. On the sample 1 it says"SQL server ce not installed" , and in the sample2, it says "Fail to initiate SQL Server CE 2.0".Frown | :(
 
So the problem is concerning the SqlServerSelfTest() on sample 1 and concerning CreateSqlSvrCeProvider() on sample 2.
 
I think it's the same problem. In the "remove programs" settings, it said that "sql server ce" is installed. So I don't know what it is?
 
In the 1st sample, I delete the SqlServerSelfTest part, and i can access the program. But when I want to access to a database, I have an error((0x80040154) Fail to connect the database).
I can delete a database, but it's just IO methods.
 
Have you got some ideas about the problem and/or Smile | :) documentations on CreateSqlServerCeProvider Method
 

 
Thanks
GeneralRe: sql ce 2.0,ppc2003, init connection Pinmemberhackzai20-Jul-05 14:34 
GeneralRe: sql ce 2.0,ppc2003, init connection Pinmembercrozet21-Jul-05 4:12 
Generalhelp needed Pinmemberkrishnamca2000@yahoo.com16-Jul-05 4:17 
Hi K-PAx,
 
first of all,I appreciate... ur work. This kind of application is really helpful to many people like me.
 
Let me tell u what i am trying for.
 
I want to create a small database and insert some information and retrieve the same information back.I want this to be done using EVC 4,SQLCE 2.0 and PockePC 2003 Emulator using OLEDB.
 
when i tried ur sample i got the following errors.
 
*************************************************************************
SqlSvrCe.obj : error LNK2005: "struct ICommandText * pICmdText" (?pICmdText@@3PAUICommandText@@A) already defined in MySqlCe.obj
SqlSvrCe.obj : error LNK2005: "struct IDBCreateCommand * pIDBCrtCmd" (?pIDBCrtCmd@@3PAUIDBCreateCommand@@A) already defined in MySqlCe.obj
SqlSvrCe.obj : error LNK2005: "struct IDBProperties * pIDBProperties" (?pIDBProperties@@3PAUIDBProperties@@A) already defined in MySqlCe.obj
SqlSvrCe.obj : error LNK2005: "struct IDBCreateSession * pIDBCreateSession" (?pIDBCreateSession@@3PAUIDBCreateSession@@A) already defined in MySqlCe.obj
SqlSvrCe.obj : error LNK2005: "struct IUnknown * pIUnknownSession" (?pIUnknownSession@@3PAUIUnknown@@A) already defined in MySqlCe.obj
SqlSvrCe.obj : error LNK2005: "struct IDBInitialize * pIDBInitialize" (?pIDBInitialize@@3PAUIDBInitialize@@A) already defined in MySqlCe.obj
emulatorDbg/MySqlCe.exe : fatal error LNK1169: one or more multiply defined symbols found
 
**************************************************************************
 
i have updated the file "ssceoledb.h" by downloading the file fromthe net. I will be thankful to u if u can help in compiling and running this smaple.
 
I have also tried to execute the sample "NorthWindOleDb" that comes with sqlce 2.0.After lot of trials i could compile the project. But not able to run it on pocketpc 2003 emulator as i am getting problem at the following line of code.
 
hr = CoCreateInstance(CLSID_SQLSERVERCE_2_0,0,CLSCTX_INPROC_SERVER,IID_IDBInitialize,void**)&pIDBInitialize);
 
can u help me in solving these problems and make my application on the target platform that i specified.
 
thanks a lot.
 
Krishna.
 

GeneralRe: help needed PinsussAnonymous26-Jul-05 3:38 
Generalproblems with disconnection Pinmemberluca98112-Jul-05 22:44 
I am trying to use SQL Server CE.
 
I would like to know something more about it; in fact, I have got some problem I think regarding connection and disconnection. In particular, when I try to connect a second time to the db, after having already executed disconnectDB a first time, I do not succeed. The reason why I cannot find a solution is that I do not well understand how the function AddRef() and Release() work.
 
Could you please explain me how they work and when the number of references to an object can increase thanks to a call to a function different from AddRef(). I think maybe it could be tha case of the QueryInterface() function.
 
Thanks for your help.
 
p.s. is it possible to find on the Internet other examples of use (in c/c++) of SQL Server CE?
GeneralRe: problems with disconnection PinmemberErick 'El Matador' Demers12-Aug-05 6:06 
GeneralRe: problems with disconnection Pinmemberluca98129-Aug-05 5:13 
GeneralRe: problems with disconnection PinmemberRio118-Oct-06 4:24 
GeneralException PinsussMarcio Camargo Oliveira27-May-05 14:06 
Hello Joao,
 

I created a new project called Teste2BD based on your article. I´ getting success opening my database and the session, but when I try to execute a single query calling "hr = m_cmdLocal.Open(g_oleDbSession,strngQuery,&propSetCmd)"
the following error message appears (I´m running EVC4 on a Intermec 700 Series Pocket PC 2003 Device in Debug mode):
 

First-change exception in Teste2BD.exe: 0x0C0000005: Access violation
 
Here follows the function where this error occurs:
 
void ModuloDados::ExecutaQueryLocal(SysString strngQuery)
{
CDBPropSet propSetCmd(DBPROPSET_ROWSET);
HRESULT hr;
 
nRowsLocal=0;
nRowLocalAtual=1;
//
// Close the command
//
m_cmdLocal.Close();
 
//
// Use a scrollable cursor
//
propSetCmd.AddProperty(DBPROP_BOOKMARKS, true );
propSetCmd.AddProperty(DBPROP_OWNUPDATEDELETE, false );
propSetCmd.AddProperty(DBPROP_OWNINSERT, false );
propSetCmd.AddProperty(DBPROP_OTHERUPDATEDELETE, false );
propSetCmd.AddProperty(DBPROP_OTHERINSERT, false );
propSetCmd.AddProperty(DBPROP_CANFETCHBACKWARDS, true );
propSetCmd.AddProperty(DBPROP_QUICKRESTART, true );
 
//
// Open the command
//
hr = m_cmdLocal.Open(g_oleDbSession,strngQuery,&propSetCmd);
 
if(hr == S_OK)
{
m_cmdLocal.MoveFirst(); // Position the cursor
hr = m_cmdLocal.GetRecordCount(&nRowsLocal); // Retrieve the row count
}

 
}
 

Thanks.

 
Marcio Camargo Oliveira
Brazil

GeneralRe: Exception PinmembershritiParashars2-Jan-07 23:29 
GeneralArticle code fix Pinmembermaxxel4-Apr-05 4:53 
1. As someone previously stated, get fixed ssceoledb.h(http://support.microsoft.com/kb/825393)
 
2. Set priority of include directory above pocket pc 2003 sdk include dir
3. add ole32.lib oleaut32.lib
 
4. move declarations of those broken
IDBInitialize *pIDBInitialize = NULL;
...
 
from SqlSvrCe.h to SqlSvrCe.cpp and
 
and define those variables in SqlSvrCe.h
extern IDBInitialize *pIDBInitialize;
 
5. remove oledb.h include and OLEDBVER, DBINITCONSTANTS, INITGUID defines
 
now it should compile without /FORCE
 

GeneralProcessRowset GetData Pinmemberjsdljasfdlfj19-Mar-05 22:06 
I'm having trouble pulling the data out of the database.
I have created a SQL query to return 3 integers, my goal is to store thoes
integers in an array.
 
Here is what I have done at the first occurance of "pIRowset->GetData" in ProcessRowset:
 
struct threeInts
{
INT32 *k1;
INT32 *k2;
INT32 *k3;
}
threeInts myOwnDataStructre;
pIRowset->GetData(hRows[lCount], hAccessor, &myOwnDataStructre);
if(myOwnDataStructre.k1)
{
memset(szBuffer, TEXT('\0'), 1024);
wsprintf(szBuffer, L",%li,%li,%li,", *(myOwnDataStructre.k1),*(myOwnDataStructre.k2),*(myOwnDataStructre.k3));
MessageBox(NULL,szBuffer,L"Row 1 Data",MB_OK);
}
else
{
MessageBox(NULL,L"Null Pointer",L"Error",MB_OK);
}

 
However the way the Pocket PC 2003 emulator behaves is to do nothing. I mean it skips the entire code was surronded by:
if(false)
{
...
}

 
The else part does not execute either.
 
(Not fully understanding what I am doing with the pointers in the wsprintf line: ) I also tried changing the wsprintf line to:
 
wsprintf(szBuffer, L",%li,%li,%li,", (myOwnDataStructre.k1),(myOwnDataStructre.k2),(myOwnDataStructre.k3));
 
This had an effect, it created the missing MessageBox() but the data given to me seems to be garbage. I guess they are memory addresses but possible they could be the data stored in some strange format that I don't understand. (I am thinking something like little endian.)
 
I am expecting to see the numbers 10,000 13,280 and 0
But I get the numbers 3,145,777 3,145,776 and 48
 
Notice that 0+48 = the ascii character "0" which led me to believe that these numbers were corrupted somehow.
 
Any suggestions?
 
Thanks
 
funky finger at gmail dot com
funky finger should be a single word

GeneralRe: ProcessRowset GetData Pinmemberjsdljasfdlfj19-Mar-05 23:20 
GeneralRe: ProcessRowset GetData Pinmemberjsdljasfdlfj20-Mar-05 14:19 
GeneralRe: ProcessRowset GetData Pinmemberjsdljasfdlfj21-Mar-05 21:30 
GeneralUnexpected end of file PinmemberWenZhong He16-Dec-04 21:41 
Smile | :) Why does it appear as fellows:
fatal error C1010: unexpected end of file while looking for precompiled header directive
when I compile my software after I add SqlSvrCe.h and SqlSvrCe.app into my project by Project->Add to project->File...
Double click the error in the debug window, the cursor jump to the end of the file of the SqlSvrCe.cpp.
GeneralRe: Unexpected end of file Pinmemberjsdljasfdlfj24-Mar-05 1:38 
GeneralLINK ERRORS + MS PATCH Pinmemberkillgec6-Dec-04 8:18 
Hi all,
Microsoft has just released a patch for SSCE 2.0 SDK here:
 
http://support.microsoft.com/kb/825393
 
Because of incomplete ssceoledb.h in SSCE 2.0 SDK, you should have included oledb.h and link to oledb.lib on CE.NET platforms, therefore got us errors on linking, and had to use /FORCE linker option to avoid multiple defined symbols.
 
Read the link above if you had such problems.
 
Otherwise thanks for K-PAX for his work.
 
Killgec
GeneralLINK ERROR! PinsussAnonymous4-Nov-04 3:20 
Why do I Receive these error messages and how can I resolve them?
Thanks in advance!
 
SqlSvrCe.obj : error LNK2005: "struct ICommandText * pICmdText" (?pICmdText@@3PAUICommandText@@A) already defined in MySqlCe.obj
 
MySqlCe.obj : error LNK2019: unresolved external symbol CoUninitialize referenced in function WinMain
 
SqlSvrCe.obj : error LNK2001: unresolved external symbol IID_IDBInitialize
 
Please Help!

Generalerror while link obj Pinmemberjesselian27-Oct-04 23:42 
Im using evc++ 4.0 SQL CE 2.0, while i build the project,the following error msgs are given:
SqlSvrCe.obj : error LNK2005: "struct ICommandText * pICmdText" (?pICmdText@@3PAUICommandText@@A) already defined in sample.obj
SqlSvrCe.obj : error LNK2005: "struct IDBCreateCommand * pIDBCrtCmd" (?pIDBCrtCmd@@3PAUIDBCreateCommand@@A) already defined in sample.obj
SqlSvrCe.obj : error LNK2005: "struct IDBProperties * pIDBProperties" (?pIDBProperties@@3PAUIDBProperties@@A) already defined in sample.obj
SqlSvrCe.obj : error LNK2005: "struct IDBCreateSession * pIDBCreateSession" (?pIDBCreateSession@@3PAUIDBCreateSession@@A) already defined in sample.obj
SqlSvrCe.obj : error LNK2005: "struct IUnknown * pIUnknownSession" (?pIUnknownSession@@3PAUIUnknown@@A) already defined in sample.obj
SqlSvrCe.obj : error LNK2005: "struct IDBInitialize * pIDBInitialize" (?pIDBInitialize@@3PAUIDBInitialize@@A) already defined in sample.obj
emulatorDbg/test.exe : fatal error LNK1169: one or more multiply defined symbols found
 
I use MS hotfix for SQL CE, I still got this. pls ads
Jesse
Generalcompiling error - please help PinmemberMario Barfus24-Aug-04 5:39 
hello,
 
i am using evc 4.0 and i added to another project the source files. when i compile the project i get several linking errors:
 
uafxwced.lib(filecore.obj) : error LNK2005: IID_IClassFactory already defined in SqlSvrCe.obj
uafxwced.lib(filecore.obj) : warning LNK4006: IID_IClassFactory already defined in SqlSvrCe.obj; second definition ignored
Creating library ARMV4Dbg/Mando.lib and object ARMV4Dbg/Mando.exp
SqlSvrCe.obj : error LNK2019: unresolved external symbol CoCreateInstance referenced in function "long __cdecl CreateSqlSvrCeProvider(void)" (?CreateSqlSvrCeProvider@@YAJXZ)
SqlSvrCe.obj : error LNK2001: unresolved external symbol IID_IDBInitialize
SqlSvrCe.obj : error LNK2001: unresolved external symbol IID_ICommandText
SqlSvrCe.obj : error LNK2001: unresolved external symbol IID_IDBCreateCommand
SqlSvrCe.obj : error LNK2001: unresolved external symbol IID_IDBCreateSession
SqlSvrCe.obj : error LNK2019: unresolved external symbol VariantClear referenced in function "long __cdecl ConnectDB(unsigned short *)" (?ConnectDB@@YAJPAG@Z)
SqlSvrCe.obj : error LNK2019: unresolved external symbol SysFreeString referenced in function "long __cdecl ConnectDB(unsigned short *)" (?ConnectDB@@YAJPAG@Z)
SqlSvrCe.obj : error LNK2001: unresolved external symbol IID_IDBProperties
SqlSvrCe.obj : error LNK2019: unresolved external symbol SysAllocString referenced in function "long __cdecl ConnectDB(unsigned short *)" (?ConnectDB@@YAJPAG@Z)
SqlSvrCe.obj : error LNK2019: unresolved external symbol VariantInit referenced in function "long __cdecl ConnectDB(unsigned short *)" (?ConnectDB@@YAJPAG@Z)
SqlSvrCe.obj : error LNK2001: unresolved external symbol IID_IDBDataSourceAdmin
SqlSvrCe.obj : error LNK2001: unresolved external symbol IID_IRowset
SqlSvrCe.obj : error LNK2001: unresolved external symbol IID_IErrorRecords
SqlSvrCe.obj : error LNK2019: unresolved external symbol GetErrorInfo referenced in function "long __cdecl GetErrorMessage(unsigned short *,int)" (?GetErrorMessage@@YAJPAGH@Z)
ARMV4Dbg/Mando.exe : fatal error LNK1120: 14 unresolved externals
Error executing link.exe.
 
please help!
 
thanks in advance,
 
Mario
QuestionMissing files? PinmemberKybert11-Aug-04 1:30 
The compiler (eMbedded V3.0).
 
demo 1:
missing include files:ssceoledb.h & coguid.h
 
demo 2:
missing a resource file?
 

What am i doing wrong here ?
AnswerRe: Missing files? Pinmemberhackzai11-Aug-04 4:01 
GeneralCan't install MS SQL Server CE, Help me! Pinmemberlam cuong2-Aug-04 23:39 
I want to connect eVC4.0 to SQLCe but first I can't install SQLCE. When finish installing SQLCE, there is an error tells that SQL CE tools compatible only with SQL 2000 server SP1 or higher. But I'm running SQL2000 Server SP3 and ISS. Anyone tell me why? And please show me the way install SQLCE? Thanks a lot.
 
Cuong
GeneralRe: Can't install MS SQL Server CE, Help me! Pinmemberjakejang24-Mar-05 17:13 
GeneralRe: Can't install MS SQL Server CE, Help me! PinsussAnonymous2-Oct-05 0:53 
GeneralRe: Can't install MS SQL Server CE, Help me! Pinmemberthanhthuyvn_vtajkhskjakjd10-Oct-05 23:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130617.1 | Last Updated 3 Mar 2003
Article Copyright 2002 by hackzai
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid