Moving from JET to SQL Server / MSDE using DAO sdk

Moving from JET to SQL Server / MSDE using DAO sdk

Author

Message

Martin-Pierre Frenett#1 / 6

Moving from JET to SQL Server / MSDE using DAO sdk

Hello everyone.

I have several applications written using the Jet Engine Database. More specifically, they use my CGeneric classes ( CGenericDatabase, CGenericRecordset ( inspired from another CGenericRecordset and CGenericTableDef ), which uses the DAO Sdk.

I am required to migrate to MSDE, and like any other low-level transition, this is expected for yesterday.

I therefore need to do a transition as smoothly as possible.

If I read properly, the DAO Sdk can handle ODBC connections.

However, I am stuck with several problems :

1 - These connections do not allow TableDefs 2 - I know nothing about MSDE ( most documentation recommend using the SQL Server documentation, but I know even less about it ) 3 - I can't realisticly rewrite all the code of all my applications 4 - I am alone to perfom these changes and do that research.

I have been reading the documentation for 2 days, on ODBC, SQL Server, MSDE, re-reading the DAO documentation, but I have yet to find an angle of attack. I only have a pile of paper on my desk and a huge headache...

I trully want to use MSDE, but were to I start ? Does anyone have any articles to point or any code to help.

I can send some samples if requested.

I understand English, French and C++ ;-)

Any replies, both on the forum and by e-mail WILL be answered. I even accept phone call from 7h00 to 12h00 EST and 13h00 to 16h00.

You need to use CDatabase and CRecordset, instead of thier DAO counter parts.

CRecordset has some significant limitations and less features compared to DAO. But the code you create for MSDE can be directly used for SQL Server, if you ever want to do it in the future.

Out of top my head an Recordset object directly created from CRecordset class cannot be updated, there is no SetFieldValue member in CRecordset.

Lot of chunks of code need to be rewritten.

You must start becoming very familiar with T-SQL. That is going to be your freind for long. Lot of times you use this function- CDatabase->ExecuteSQL(pchSQL), to update, delete add records table, etc.

cheers. jay.

Quote:

> Hello everyone.

> I have several applications written using the Jet Engine Database. More > specifically, they use my CGeneric classes ( CGenericDatabase, > CGenericRecordset ( inspired from another CGenericRecordset and > CGenericTableDef ), which uses the DAO Sdk.

> I am required to migrate to MSDE, and like any other low-level transition, > this is expected for yesterday.

> I therefore need to do a transition as smoothly as possible.

> If I read properly, the DAO Sdk can handle ODBC connections.

> However, I am stuck with several problems :

> 1 - These connections do not allow TableDefs > 2 - I know nothing about MSDE ( most documentation recommend using the SQL > Server documentation, but I know even less about it ) > 3 - I can't realisticly rewrite all the code of all my applications > 4 - I am alone to perfom these changes and do that research.

> I have been reading the documentation for 2 days, on ODBC, SQL Server, MSDE, > re-reading the DAO documentation, but I have yet to find an angle of attack. > I only have a pile of paper on my desk and a huge headache...

> I trully want to use MSDE, but were to I start ? Does anyone have any > articles to point or any code to help.

> I can send some samples if requested.

> I understand English, French and C++ ;-)

> Any replies, both on the forum and by e-mail WILL be answered. I even accept > phone call from 7h00 to 12h00 EST and 13h00 to 16h00.

I am already familliar with SQL, and will use it in I can't do otherwise.

But I cannot use the DAO MFC Classes, such as CDatabase, I must use the DAO Sdk ( CdbDatabase ) because DAO MFC Classes cannot be used in COM Objects or in threads using COM objects that require a special initialization.

Therefore, I am still in the Dark on this...

I know that the DAO sdk can connect to a ODBC database, and I approximatly know how, I just need to know the details, and what are the main differences between using OBDC and Jet with the SDK. I also know what to do on MSDE ? Can I admnister everything from code ( I would prefer ). Can I even create a database and it's tables ???

But thank you very much ! I appreciate your quick answer... At least, if MSDE works well with the DAO MFC, it means that it will work with the SDK, since the MFC classes are built from the SDK.

Do you develop using the MSDE / SQL Server engine ? Does it really work well with ODBC ? Do I need some sort of special initialization ?

>You need to use CDatabase and CRecordset, instead of thier DAO counter >parts.

>CRecordset has some significant limitations and less features compared to >DAO. But the code you create for MSDE can be directly used for SQL Server, >if you ever want to do it in the future.

>Out of top my head an Recordset object directly created from CRecordset >class cannot be updated, there is no SetFieldValue member in CRecordset.

>Lot of chunks of code need to be rewritten.

>You must start becoming very familiar with T-SQL. That is going to be your >freind for long. Lot of times you use this function- >CDatabase->ExecuteSQL(pchSQL), to update, delete add records table, etc.

>cheers. >jay.

Sun, 02 Mar 2003 23:00:14 GMT

Jay Balap#5 / 6

Moving from JET to SQL Server / MSDE using DAO sdk

Dude,

CDatabase and CDaoDatabase is different.

CDatabase is not a DAO MFC class, it is a ODBC MFC Class.

Similarly CRecordset and CDaoRecordset is not the same.

As far as I know ODBC driver for SQL Server classes are thread safe.

Why are you still going back to DAO man, dont use anything with DAO in it , when you want to write for MSDE/SQL Server always use CDatabase/CRecordset or use raw ODBC calls.

cheers. jay.

Quote:

> Thank you for the message.

> I am already familliar with SQL, and will use it in I can't do otherwise.

> But I cannot use the DAO MFC Classes, such as CDatabase, I must use the DAO > Sdk ( CdbDatabase ) because DAO MFC Classes cannot be used in COM Objects or > in threads using COM objects that require a special initialization.

> Therefore, I am still in the Dark on this...

> I know that the DAO sdk can connect to a ODBC database, and I approximatly > know how, I just need to know the details, and what are the main differences > between using OBDC and Jet with the SDK. I also know what to do on MSDE ? > Can I admnister everything from code ( I would prefer ). Can I even create a > database and it's tables ???

> But thank you very much ! I appreciate your quick answer... At least, if > MSDE works well with the DAO MFC, it means that it will work with the SDK, > since the MFC classes are built from the SDK.

> Do you develop using the MSDE / SQL Server engine ? Does it really work well > with ODBC ? Do I need some sort of special initialization ?

> >CRecordset has some significant limitations and less features compared to > >DAO. But the code you create for MSDE can be directly used for SQL Server, > >if you ever want to do it in the future.

> >Out of top my head an Recordset object directly created from CRecordset > >class cannot be updated, there is no SetFieldValue member in CRecordset.

> >Lot of chunks of code need to be rewritten.

> >You must start becoming very familiar with T-SQL. That is going to be your > >freind for long. Lot of times you use this function- > >CDatabase->ExecuteSQL(pchSQL), to update, delete add records table, etc.

> >cheers. > >jay.

Sun, 02 Mar 2003 23:16:03 GMT

Crai#6 / 6

Moving from JET to SQL Server / MSDE using DAO sdk

Martin, I am currently doing development with MSDE. All it is is scaled down version of SQL Server. I havent seen anything it cant do that SQL server can. Anyway, when we first decided to move to a more robust database I had all my code written in C++ using DAO Recordset classes. Once we made the move I wrote a class that almost was identical to CRecordset and called it CStoredProcedure. It has all your basic recordset functions that you will probably ever need and makes calling stored procedures and opening recordsets a breeze. The only difference in this class is that it uses ADO instead of MFC. Which would require you to register the ADO dlls on the clients machines, but thats no biggie if you already have to install MSDE :)

If this class sounds like something you would like to use let me know and I can send you a copy of the project.

Good luck, Craig

Quote:

> Thank you for the message.

> I am already familliar with SQL, and will use it in I can't do otherwise.

> But I cannot use the DAO MFC Classes, such as CDatabase, I must use the DAO > Sdk ( CdbDatabase ) because DAO MFC Classes cannot be used in COM Objects or > in threads using COM objects that require a special initialization.

> Therefore, I am still in the Dark on this...

> I know that the DAO sdk can connect to a ODBC database, and I approximatly > know how, I just need to know the details, and what are the main differences > between using OBDC and Jet with the SDK. I also know what to do on MSDE ? > Can I admnister everything from code ( I would prefer ). Can I even create a > database and it's tables ???

> But thank you very much ! I appreciate your quick answer... At least, if > MSDE works well with the DAO MFC, it means that it will work with the SDK, > since the MFC classes are built from the SDK.

> Do you develop using the MSDE / SQL Server engine ? Does it really work well > with ODBC ? Do I need some sort of special initialization ?

> >CRecordset has some significant limitations and less features compared to > >DAO. But the code you create for MSDE can be directly used for SQL Server, > >if you ever want to do it in the future.

> >Out of top my head an Recordset object directly created from CRecordset > >class cannot be updated, there is no SetFieldValue member in CRecordset.

> >Lot of chunks of code need to be rewritten.

> >You must start becoming very familiar with T-SQL. That is going to be your > >freind for long. Lot of times you use this function- > >CDatabase->ExecuteSQL(pchSQL), to update, delete add records table, etc.