DB connection in SQL CE



Hi All,

I'm new to SQL CE and i'm using SQL CE 2.0.
I've created the database and created a table 'Employees' and when i tried to insert a row into the table i'm getting the negative value for hr.

I'm using the handheld device CASIO IT700 to run the application using ActiveSync.
The code is:

InitializeReplicationRDA();
hr = CoCreateInstance(CLSID_RemoteDataAccess, NULL, CLSCTX_INPROC_SERVER, IID_ISSCERDA, (LPVOID *)&CERDA);
CERDA->put_InternetURL(L"http://localhost/VirtualServer/sscesa20.dll";);
CERDA->put_InternetLogin(L"sa");
CERDA->put_InternetPassword(L"sqladmin");
CERDA->put_LocalConnectionString(L"Provider=microsoft.sqlserver.oledb.ce.2.0;Data Source=NewDatabase.sdf");
wcscpy(wszConnectString, L"provider=sqloledb; data source=system81; Initial Catalog=NewDatabase.sdf; user id=sa; password=sqladmin");
wcscpy(wszLocalTable, L"Employees");
wcscpy(wszErrorTable, L"T1_Err");
wcscpy(wszQuery, L"INSERT INTO Employees values ('Davolio','Nancy'))");
bstrConnectStr = SysAllocString(wszConnectString);
bstrQuery = SysAllocString(wszQuery);
hr = CERDA->SubmitSQL((WCHAR*)bstrQuery,
(WCHAR*)bstrConnectStr);
if(FAILED(hr))
{
goto Exit;
}
SysFreeString(bstrQuery);
SysFreeString(bstrConnectStr);
CERDA->Release();

Exit:

Kindly help me.

Regards,
Farzana.

From http://developmentnow.com/g/97_0_0_0_0_0/sql-server-ce.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
.



Relevant Pages

  • Re: pl/sql: display employees who hired in specific month
    ... So far, when I run my script, all employees (including emp who are ...    END LOOP; ... SQL> -- Your code, using EMP table ... SQL> SET SERVEROUTPUT ON ...
    (comp.databases.oracle.server)
  • IIS 6 and SQL 2003 sp4
    ... databases in SQL, one called Employees and the other Postal Codes (a.k.a. ... what is the best way to configure a database to be ...
    (microsoft.public.sqlserver.setup)
  • Re: Skipping detail lines in a report
    ... SELECT Employees.* ... any of the filter words are located anywhere in the Address field. ... No code, no muss, just SQL. ... I spin through the entire array of filter-words (it's ...
    (microsoft.public.access.reports)
  • Re: Self-join question
    ... Thank you, Roel. ... > I don't think you can do that with SQL Server's SQL dialect. ... > FROM Employees ... > EmployeeID ManagerID Name ...
    (microsoft.public.sqlserver.programming)
  • Re: pl/sql: display employees who hired in specific month
    ... So far, when I run my script, all employees (including emp who are ...    END LOOP; ... SQL> -- Your code, using EMP table ...
    (comp.databases.oracle.server)