hello Visio coding artisans,
I know how to write VBA code in the SDK environment of Visio to source data from an Access database.
How different would the following code be, if the query was toward a SQL database. ?
Could you provide a sample of the code please.
TIA

following example of VBA coded query on a 64 bit MS access database. -> (NetTracker.accdb)
Public Function GraphicPermission() As Boolean
Dim rstsource As Recordset
Dim db As Database
Dim ID As String
Set db = DBEngine.OpenDatabase(ThisDocument.path & "NetTracker.accdb")
ID = modLocking.GetUserName
GraphicPermission = True
Set rstsource = db.OpenRecordset("SELECT tblUser.UserID, tblUser.Username, tblUser.Level " & _
"FROM tblUser " & _
"WHERE (((tblUser.UserID)= '" & ID & "'));")
num = EnumerateSet(rstsource)
GraphicPermission = False
If rstsource.RecordCount = 1 Then
With rstsource
.MoveFirst
Do While Not .EOF
If !Level = 2 Then
GraphicPermission = True
End If
.MoveNext
Loop
.Close
End With
Else
GraphicPermission = False
End If
db.Close
End Function