hi everyone,
i am using sql server 2005 to connect to a vb6 or earlier version app.
i appear to be having a problem with the connection string - i have been to
http://www.connectionstrings.com with no luck.
my script looks as follows:
code looks as follows:
- function LaunchApp()
-
{
-
var result, Cmd;
-
-
sqlQryLaunchSDH = "select colname from table";
-
-
openConnection();
-
-
// Create a new object
-
Cmd = ADO.CreateADOCommand();
-
// Specify the command type
-
// Cmd.ActiveConnection = conn; = this is not supported
-
-
-
Cmd.CommandType = adCmdText;
-
-
// Specify the command text (the SQL expression)
-
-
Cmd.CommandText = sqlQryLaunchSDH; //read in text qry
-
-
// Execute the command
-
-
result = Cmd.Execute(); //does not work Missing Connection or ConnectionString exception
-
-
}
-
-
function openConnection()
-
{
-
conn = ADO.CreateConnection();
-
-
conn.ConnectionString = "Driver={SQL Native Client};Server=servername\\instancename;Database=dbname;Trusted_Connection=yes;";
-
conn.Open();
-
}
Initially i received the following error:
1] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I then changed the connection string however I then ended up with this error
2] Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done
3] Now with the code above I am able to make progress until I get to results = Cmd.Execute()
Where I get ‘Missing Connection or ConnectionString’ exception
anyone experience this problem before?