DBConnect - Help please.

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
PaulSR
Pro Scripter
Posts: 65
Joined: Mon Aug 05, 2013 2:58 pm
Location: Edinburgh/Peterborough

DBConnect - Help please.

Post by PaulSR » Tue Jun 03, 2014 10:58 am

Hi All,

I haven't used this before now and haven't had any need to query a database directly in a while. Basically we have a vendor offsite who has a MySQL database which I need to connect to, retrieve some data then empty the table in question but the problem is I can't get connected to the database and I'm sure it's a problem with syntax or something at my end.

Until about 5 minutes ago I couldn't even get a return value from the DBConnect command but I am now receiving one. Is anybody able to look at the below and tell me what the problem might be?

Code: Select all

Let>str=Driver={MySQL ODBC 3.51 Driver};Server=theurlofhthe.website.com;Database=tos_data;User=theusername;Password=thepassword
DBConnect>str,dbH
The dbH value returns as :

ERR [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I suspect I'm not giving enough information here....

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: DBConnect - Help please.

Post by JRL » Tue Jun 03, 2014 3:08 pm

I don't have a MySQL database to test with but judging from the error message you may not have the correct driver and or you may not be specifying the URL properly.

For the driver issue I assume you've been to http://www.connectionstrings.com/mysql/ and looked over the collection of connection strings available.

For the URL issue. Try it with "http:\\" and without. Have you tried "https:\\"? Have you tried putting quotes around the whole thing? ...;Server="theurlofhthe.website.com";...

PaulSR
Pro Scripter
Posts: 65
Joined: Mon Aug 05, 2013 2:58 pm
Location: Edinburgh/Peterborough

Re: DBConnect - Help please.

Post by PaulSR » Tue Jun 03, 2014 3:22 pm

Hi JRL,

Thanks for the advice - I will give them a try but I think you were right the first time and I am missing some or all of the files for the driver. I tried changing it to SQL and that returned an error saying the credentials were incorrect or similar rather than a general initialisation failure.

I will try your suggestions though whilst I wait for somebody at our helpdesk to action my ticket around the drivers - that gives me at least a few days to play with :lol:

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: DBConnect - Help please.

Post by JRL » Tue Jun 03, 2014 3:26 pm

"a few days"??? Wow. Wish I could get away with that.

PaulSR
Pro Scripter
Posts: 65
Joined: Mon Aug 05, 2013 2:58 pm
Location: Edinburgh/Peterborough

Re: DBConnect - Help please.

Post by PaulSR » Wed Jun 04, 2014 2:18 pm

Turns out it only took half a day - needed 32bit SQL connector installed on my laptop but all is good now and I have a connection to the database !

Thanks for the pointers !

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts