Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I read a text file & write (populate) to a SQL server 7.0

Status
Not open for further replies.

Sal2K

Technical User
Jun 22, 2001
2
CA
How do I read a text file using C and write (populate) to a SQL Server 7.0 table. If it is possible, will it be faster than if I used VB for that. It takes for VB 75 seconds just to read into memory 1.3 MB file. It is too slow for me since I have to process great many files. Any tip is appreciated. Thanks
 
The best API for C programmers in windows is ODBC. Try to study it.
The basis is
1. Allocate environment with SQLAllocEnv
2. Allocate connection with SQLAllocConnect
3. Connect with SQLConnect or SQLDriverConnect(better than SQLConnect)
4. Allocate statement with SQLAllocStmt
5. work SQLExecDirect/SQLPrepare&SQLExec/SQLBind*/SQLParamData/SQLPutData,SQLFetch
6. SQLFreeStmt
7. SQLDisconnect
8. SQLFreeConnect
9. SQLFreeEnv

Each function uses handles and return retcodes what are SQL_SUCCESS, SQL_SUCCESS_WITHINFO, SQL_ERROR, SQL_INVALID_HANDLE and some many codes. For get error descriptions use SQLError. John Fill
1c.bmp


ivfmd@mail.md
 
take a look at thread205-113862 bluenote@uyuyuy.com
(excuse my english)
 
no, its for sal2k :~/
bluenote@uyuyuy.com
(excuse my english)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top