1

i am working with a vbaccelerators' sgrid and need to load records as fast as i can.

am want ti use a recordset (am already using a collection) to store loaded records so that i effect any changes to the grid on it, save the changes to the recordset until i click save, then update the database with the recordset.

currently i load data from database to collection, from collection to grid. this makes the app slow for over 10k records which have to all be loaded once not in batches. using a recrdset will avoid two looping as i mentioned above.

my questions is how to i insert, delete, update specifi record(s) in a recordset? are there any utility classes or libraries to acheive this?

thanks

4

2 回答 2

0

你看过下面的链接吗

VB6 ADODB 记录集更新

这将帮助您更新记录

于 2012-12-21T20:14:45.217 回答
0

您还可以使用连接的执行方法,如下所示。只需编写普通的 sql 插入查询并传递给连接执行方法。

 Dim strConnection As Strin
 strConnection = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=SepsisQStar"
 Set gcnMain = New ADODB.Connection
 gcnMain.Open strConnection


strCom =  "INSERT INTO RawData (FileName, FileTimeStamp, SampleName, MOverZ, Intensity) VALUES ('"
              strCom = strCom & FileName & "','"
              strCom = strCom & FileTimeStamp & "','"
              strCom = strCom & SampleName & "',"
              strCom = strCom & MoverZ & ","
              strCom = strCom & Intensity & ")"


gcnMain.Execute strCom, , adCmdText 
于 2012-12-20T10:47:57.867 回答