Ask a Question

Throwing error on the DB table

mcmprashanth
Occasional Contributor

Throwing error on the DB table

Hi, Can someone suggest why testcomplete is throwing error on my table name statement (aCmd.CommandText = "account_name") as "Invalid object name".

It appears to connect to DB fine as aCon.State is returning as 1. Not sure why it isn't accepting the table name.

 

  aCon = ADO.CreateConnection();
  // Sets up the connection parameters
  aCon.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=XXXXXXX;Data Source=XXXX";
  // Opens the connection
  aCon.Open();
  Log.Message(aCon.State);
  // Creates a command and specifies its parameters
  aCmd = ADO.CreateCommand();
  aCmd.ActiveConnection = aCon; // Connection
  aCmd.CommandType = adCmdTable;
   // Command type
  aCmd.CommandText = "account_name"; // Table name
  // Opens a recordset
  aRecSet = aCmd.Execute();
  aRecSet.MoveFirst();
 }

cancel
Showing results for 
Search instead for 
Did you mean: