CAD software discussion forum > CAD > database connect error

database connect error

Rank: 1

mikela1994

Newbie

posts: 2

Registered: 2013-12-16

Message 1 of 1

 database connect error
27-12-2013 09:25 . pm | View his/her posts only

Hi All,


I have the following code the connects to a Access Database,


Private Sub connect_Click()

Dim door As String

Dim panels As String

panels = "panels"

door = "doors"

Set dbInfo = OpenDataBase("C:\Users\DevelopmentBureau\Documents\TechAd.mdb")

Set rsInfo = dbInfo.OpenRecordset("SELECT *FROM layersWHERE layer = '" & door & "'", dbOpenDynaset)


If (rsInfo.RecordCount <> 0) Then

MsgBox(rsInfo("id"))

MsgBox(rsInfo("layer"))

rsInfo.Close

End If


dbInfo.Close


End Sub


This work fine in ZwCad 2012 but throws an error in ZwCad 2014.


Run-time error 13



This is line of code is where the error is:-


Set rsInfo = dbInfo.OpenRecordset("SELECT *FROM layersWHERE layer = '" & door & "'", dbOpenDynaset)


Any ideas?

See also