programming in VB - need help

acejj26

Senior member
Dec 15, 1999
886
0
0
Does anyone know how to execute a SQL statement, in Visual Basic, with the sole purpose of ordering data in a database? If so, please let me know.
 

Train

Lifer
Jun 22, 2000
13,577
72
91
www.bing.com
what databse are you hookng up to? im assuming an access database?

well, heres howd id do it in script:


<<
DIM AdoConn
DIM rsRecordset

Set AdoConn = CreateObject.(&quot;ADODB.Connection&quot;)

AdoConn.Open &quot;DSN=myAccessDSN&quot; 'Assuming you have the access db set up as a DSN, which i recomend

Set rsRecordset = CreateObject&quot;(ADODB.RecordSet&quot;)

rsRecordset.Open &quot;Select * From myTable sort By Field1&quot;, AdoConn 'this is where your SQL goes.
>>

then use the recordset accordingly....