Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 4th, 2007, 10:26 PM
Registered User
 
Join Date: Aug 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADODB connection fails (better topic)

Hi all!

I had posted this as a followup to a different question, but for future reference of those having trouble I decided to repost it under a better topic header.

My problem is this:

DIM cn as ADODB.connection
DIM rs as ADODB.recordset
DIM SQLString as String
SQLString = "INSERT INTO table_name (Blah, blah, blah) VALUES (yadda, yadda, yadda)"
cn = set new ADODB.conn.... etc
etc
etc

And everything's fine until I hit this part of the program:


cn.Open "Driver={MySQL ODBC 3.51 Driver};Server=www.oursqldomain.net;Port=3306;Data base=data_base;User=data_user; Password=abc123;Option=3;"

And then it dies like a kamikazee lemming at the Grand Canyon.

Any ideas? Thanks!

-DW

P.S. For reference, I'm trying to connect to a MySQL server on our website FROM an access (VBA) form using an On_Click() event.
 
Old September 4th, 2007, 10:32 PM
Authorized User
 
Join Date: Jul 2007
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to vksingh24
Default

instead of your domain name use the IP address of your website:

cn.Open "Driver={MySQL ODBC 3.51 Driver};Server=111.11.11.111;Port=3306;Database=da ta_base;User=data_user; Password=abc123;Option=3;"

__________________
Vikash Kumar Singh
 
Old September 4th, 2007, 10:43 PM
Registered User
 
Join Date: Aug 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nope. = (

I just gave it a try.
Unfortunately, that line, and everything afterwards, refuses to execute.

Is there anything I should be including as far as external ActiveX controls or something?
I've already included Microsoft ActiveX Data Objects 2.7 and Data Objects Recordsets 2.7

Thanks!

-DW

 
Old September 4th, 2007, 11:02 PM
Authorized User
 
Join Date: Jul 2007
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to vksingh24
Default

what is the error message showing up

__________________
Vikash Kumar Singh
 
Old September 4th, 2007, 11:04 PM
Registered User
 
Join Date: Aug 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

By the by - the website is hosted at a place, I just realized, that I CAN'T connect to our website via the IP addy, as it's using the ip address for lots of other sites. It's probably a linux server set to route websites based on the domain name requested by the incoming server.

typing 1.11.1.11 in a web browser won't work. I'd have to type 1.11.1.11/~domain to see our actual site.

Might this have something to do with it and can I get around that?

 
Old September 4th, 2007, 11:55 PM
Registered User
 
Join Date: Aug 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Vikash:

No error messaged whatsoever. It just stops and won't execute anything after that line.

The original author somehow has disabled error messages, and I am not certain how to re-enable them.

I've been reduced to using MsgBox items to tell me where it stops executing (I.E. MsgBox "Line34" , MsgBox "Line 36" , etc.)

The messagebox right before cn.open executes.
The messagebox right after does not. (I.E. the line of the CN doesn't execute and everything afterwards fails to execute as well)

 
Old September 5th, 2007, 09:35 PM
Registered User
 
Join Date: Aug 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Found it!

Rather than cn.open "Driver=....etc. etc."

it should be:

cn.ConnectionString = "Driver=....etc. etc."

and then simply:

cn.Open






Similar Threads
Thread Thread Starter Forum Replies Last Post
Help.Can i use ADODB.Connection with DetailsView? aekta ASP.NET 2.0 Professional 5 March 11th, 2007 06:08 AM
ADODB.Connection on every page? Steve777 Classic ASP Professional 10 September 13th, 2006 08:19 AM
ADODB.Connection (0x800A0E7A) sumanst Classic ASP Databases 1 August 5th, 2005 02:56 PM
ADODB connection for Recordset dpatole Beginning VB 6 1 October 14th, 2003 04:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.