CS = ("Provider=SQLOLEDB;Data Source=YT077\SQLEXPRESS;Initial Catalog=demobase;User Id=sa;Password=1234;");
con = new ComObject("ADODB.Connection");
con.ConnectionString=CS;
con.Open(CS);
// считать из таблицы Counters значения pList и pMark
CountersRead = New ComObject("ADODB.Command");
CountersRead.ActiveConnection = con;
CountersRead.CommandText = "SELECT * FROM COUNTERS WHERE TableName='PLIST' OR TableName='PMARK'";
CountersRead.CommandType = 1;
CountersWrite = New ComObject("ADODB.RecordSet");
CountersWrite = CountersRead.Execute();
while CountersWrite.EOF = 0 do
If CountersWrite.Fields("TableName").Value="PLIST" then
pListIndex = CountersWrite.Fields("Counter").Value;
endif;
If CountersWrite.Fields("TableName").Value="PMARK" then
pMarkIndex = CountersWrite.Fields("Counter").Value;
endif;
CountersWrite.MoveNext();
enddo;
Add a code snippet to your website: www.paste.org