Hi, Everyone
I am very new to VB scripting. I am trying to query for specific information in a database via ODBC connection that has many fields. I only want to display certain fields that match my criteria. The table name has a space.I am not sure I need to include the server name, user name and password. Here is what I have so far just to test connection but I am getting "expected end of statement". Thanks everyone in advance.
Once I have this piece done, I next thing I want to do is have a routine that does a text-to-speech of the result.
P.S. I have no control over the naming convention.
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set objConnection = CreateObject("ADODB.Connection"
Set objRecordset = CreateObject("ADODB.Recordset"
objConnection.Open "DSN=ticketquery;server=myserver;uid=cjohnny;pwd=password;"
objRecordset.CursorLocation = adUseClient
objRecordset.Open "SELECT "My Case"."Assigned To","My Case"."User Description" FROM "My Case" WHERE "My Case"."Assigned To"='cjohnny' , objConnection adOpenStatic, adLockOptimistic"
objRecordset.Close
objConnection.Close
I am very new to VB scripting. I am trying to query for specific information in a database via ODBC connection that has many fields. I only want to display certain fields that match my criteria. The table name has a space.I am not sure I need to include the server name, user name and password. Here is what I have so far just to test connection but I am getting "expected end of statement". Thanks everyone in advance.
Once I have this piece done, I next thing I want to do is have a routine that does a text-to-speech of the result.
P.S. I have no control over the naming convention.
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set objConnection = CreateObject("ADODB.Connection"
Set objRecordset = CreateObject("ADODB.Recordset"
objConnection.Open "DSN=ticketquery;server=myserver;uid=cjohnny;pwd=password;"
objRecordset.CursorLocation = adUseClient
objRecordset.Open "SELECT "My Case"."Assigned To","My Case"."User Description" FROM "My Case" WHERE "My Case"."Assigned To"='cjohnny' , objConnection adOpenStatic, adLockOptimistic"
objRecordset.Close
objConnection.Close