I have some logic to connect to a database, and add new records. I'm getting an error message that the SQL statement is invalid on the open method of the recordset. I actually don't even want to select anything. All I want to do it connect to the database, then add a number of records (in batch if possible) and then test to ensure it's saved.
My code follows below. (the connect method is just pseudocode - i know it works)
Public Function ConnectGIS() as boolean
if goConn.Open strConnectionstring Then
ConnectGIS = True
Public Function UploadNewRecords() as boolean
If ConnectGIS Then
.Source = gisSchemaName & ".ISSUES"
.ActiveConnection = goConn
.CursorType = adOpenStatic
oNewIssues.Open "Select * from " & gisSchemaName & ".ISSUES"
For i = 0 To oIssues.Count - 1
ipos = InStr(1, oIssues.Item(i), "-")
.Fields("GEO_ID") = Mid(oIssues.Item(i), 1, ipos - 1)
.Fields("ISSUE_CLASS") = Mid(oIssues.Item(i), ipos + 1, InStr(ipos + 1, oIssues.Item(i), "-"))
UploadIssuesToGIS = True
mstrError = "Unable to connect to the GIS database at this time"
UploadIssuesToGIS = False