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
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