Page 1 of 1

AdoDB

Posted: Mon Mar 16, 2009 9:32 am
by paracelsus
Hello! How can I connect to a database and write data in a table? I try to use the following code:

Code: Select all

Public Sub connectDatabase()

Set cnWorkShop = New ADODB.Connection
With cnWorkShop
	.Provider = "Microsoft.JET.OLEDB.4.0"
	.ConnectionString = "Data Source=ServerName;Initial Catalog=posta;"
	.Open
End With
But I got a lot of errors!

Posted: Mon Mar 16, 2009 11:09 am
by Support Team
Please, post only Ranorex specifc questions in this forum. It's important to understand that we cannot support questions that do not relate to the Ranorex framework.

Thanks!

Regards,
Alex
Ranorex Support Team

ranorex support

Posted: Mon Mar 16, 2009 12:19 pm
by paracelsus
I understand it, but I know to do this connection with QTP without problem. I dont understand that why it is wrong in the Ranorex. This is the reason, that I wrote my question in the Ranorex forum.

Posted: Mon Mar 16, 2009 1:50 pm
by Support Team
I would like to help you, but you need to post the errors that occur!

Please, have a look on the following website for the right connection string to your database:
http://www.connectionstrings.com/
The "Data Source" needs to specify your server name (e.g. "serverName\instanceName") and the "Initial Catalog" is the name of your database.

Regards,
Alex
Ranorex Support Team