Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to move data into a SQL-Server database?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00540114
Message ID:
00540666
Vues:
22
This message has been marked as the solution to the initial question of the thread.
>Larry,
>
>Thanks. I can always count on high-quality tech information from you.
>
>>>If you really want to get down and dirty, check out this link (http://msdn.microsoft.com/library/en-us/oledb/htm/oledbabout_the_ole_db_documentation.asp). You would need to implement your connectivity via the OLEDB provider for SQL Server. Of course, you could always use ADO as George suggested because it wraps this functionality for you already into a COM interface.
>
>As I said in my reply to Hector, I'm trying to find out if I can write directly to SQL Server with low-level file IO calls. I'm getting the feeling that I can't (which doesn't really suprise me) but either way, I'm getting my answer.
>

Thom,
Thanks for the compliment. :-)

It sounds as though you are looking to write directly to the MDF/LDF file. No joy there. Without breaking into MS, I don't know where you could get the structure of those files in order to do it successfully. The key word is successfully.

The structure to the DBF is readily available and you could conceivably do it using Fopen/Fwrite/Fclose (or the C++ equivalents) but you would need to do the same things in C++ that the VFP internals already do (append information to end of file, change header bytes to reflect new record count, etc.).

The same is true for SQL Server. You either have to write your own OLEDB provider or use someone else's. Either way, you have to go through the same SQL Server interfaces exposed for these purposes because there is alot gonig on when you insert into SQL Server (logging, transactions, master tables updated if certain column types exist, etc.). The exposed interfaces interact with the non-exposed to handle this stuff.

Good luck!

BTW, here is another KB article to take a look at. It gives you C++ source code to handle large amounts of data. http://support.microsoft.com/support/kb/articles/Q246/2/62.ASP
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform