Set rst = db.OpenRecordset(sSQL)

Joined
Jul 22, 2008
Messages
4
Reaction score
0
hello guys
I am getting this error Run time error '13': Type mismatch in this sql sentence: Set rst = db.OpenRecordset(sSQL)
The module I have starts like this:

Option Compare Database

Sub main()

Dim db As Database
Dim rst As Recordset
Dim sSQL As String
Dim sBID As String
Dim sOutputString(1 To 26) As String
Dim counter As Integer
Dim columnNames(2 To 26) As String


Set db = CurrentDb
sSQL = "DELETE * FROM myTable"
db.Execute sSQL

sSQL = "SELECT * FROM myQuery ORDER BY IdMyQuery"
Set rst = db.OpenRecordset(sSQL)
....
....
End Sub
Does anyone know anything to fix it?
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top