
how to execute SQL statements
OR
Firstly, add the DAO (2.5/3.5) refference.
Dim db as Database
Dim SQLString as String
Dim QueryResult as Recordset
SQLString = "SELECT * FROM <tablename>"
Set QueryResult = db.OpenRecordset(SQLString)
Quote:
>Dim Db as Database
>Set Db = OpenDatabase("myMDB")
>SQl = "blah ......
>Db.Execute SQL
>>Hi all,
>>how do i execute SQL statements in VB?
>>in ASP programming, i make a string of the statement i want (SQL = "Select
*
>>from table where name="me") then let the database connection execute it
>>(DBConn.execute (SQL) ).
>>how do i make this in visual Basic 6.0?
>>Thanks.