You can use the Execute method of the ADO connection or command object:
Dim adcDB As ADODB.Connection
Dim strSQL As String
Dim lngAffected As Long
Set adcDB = New ADODB.Connection
With adcDB
.ConnectionString = <connection string>
.Open
End With
strSQL = "INSERT INTO Temp SELECT * FROM Current"
adcDB.Execute strSQL, lngAffected, adCmdText + adExecuteNoRecords
Quote:
>I am using SQL 7 and VB 6 with ADO connections.
>I need to execute an SQL statement without having it associated to an
object
>like a grid or recordset. When I click a button, I need to execute a
INSERT
>INTO statement. I have written and confirmed the SQL statements, now I
just
>need to execute it. Basically execute a standalone SQL statement. Any
>info. would be appreciated.
>Thanks,
>Brock