VBFOXDEV35
Programmer
All:
I have just created a master asset file table in SQL server of about 1 million records (15 fields) for my company. They want to keep track assets for a given 2 years and add new ones as we move along.
The program that updates the assets is in VFP using ADO. The new assets are in a VFP table and I use ADO to update the SQL server table. My testing (on the SQL table being 250,000 test records) was successful using the following code:
oADORs = CREATEOBJECT("ADODB.Recordset"
oADORs.ActiveConnection = oADOConn
oADORs.Source = "Select * from .dbo.tblMasterLoans"
oADORs.CursorType = 3
oADORs.LockType = 3
oADORs.Open
DO WHILE NOT EOF()
oADORs.AddNew
oADORs.Fields("AssetNumber".Value = ALLTRIM(strtran(t1lnnu," ","")
oADORs.Update
skip
enddo
But now since the database is about 1 million records, I am getting a timeout error in VFP.
I guess my real question is, should I forgo the ADO, create an XML file of the VFP table, and then create stored procedures in SQL server to add the data?
Or is there another way of doing this easily?
Thanks all for those who reply.
Art
Art DeGaetano II
Software Developer, MOUS
I have just created a master asset file table in SQL server of about 1 million records (15 fields) for my company. They want to keep track assets for a given 2 years and add new ones as we move along.
The program that updates the assets is in VFP using ADO. The new assets are in a VFP table and I use ADO to update the SQL server table. My testing (on the SQL table being 250,000 test records) was successful using the following code:
oADORs = CREATEOBJECT("ADODB.Recordset"
oADORs.ActiveConnection = oADOConn
oADORs.Source = "Select * from .dbo.tblMasterLoans"
oADORs.CursorType = 3
oADORs.LockType = 3
oADORs.Open
DO WHILE NOT EOF()
oADORs.AddNew
oADORs.Fields("AssetNumber".Value = ALLTRIM(strtran(t1lnnu," ","")
oADORs.Update
skip
enddo
But now since the database is about 1 million records, I am getting a timeout error in VFP.
I guess my real question is, should I forgo the ADO, create an XML file of the VFP table, and then create stored procedures in SQL server to add the data?
Or is there another way of doing this easily?
Thanks all for those who reply.
Art
Art DeGaetano II
Software Developer, MOUS