Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RUN TIME ERROE ‘13’ Type Mismatch.

Status
Not open for further replies.

goobil

Technical User
Aug 9, 2003
38
0
0
AG
Hi all,
I am testing a data module just to open an access database and am getting a RUN TIME ERROE ‘13’ Type Mismatch.
Then I used the debug mode connecting to the database was ok I think the problem is in the select statement.

Please help

Frmtest
Option Explicit

Sub Form_load()
Dim rstest As Recordset
Dim sql1 As String

Call DataOpen

sql1 = "select * from personalinfo"
Set rstest = gdb.OpenRecordset(sql1)

End Sub

This is the code in the data Module

Option Explicit


Public gdb As Database
Public gstrDatabase As String


'Public Function DataOpen() As Boolean
Public Function DataOpen() As Integer
gstrDatabase = (App.Path & "\data\holyfamily.mdb")
'gstrDatabase = "C:\Holyfamily\data\holyfamily.mdb"

Set gdb = DBEngine.Workspaces(0).OpenDatabase(gstrDatabase)
DataOpen = True
End Function
 
Get rid of the brackets...

gstrDatabase = App.Path & "\data\holyfamily.mdb"
 
I remove the brackets and i get another error
Invalid operation. (Error 3219)
I am using MS access2003 and was wondering if the problem is the database by using DAO as the data engine because when i connect directly to the database from within the form i don’t get any error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top