PC Review


Reply
Thread Tools Rate Thread

Create DSN with VBA Code MySQL

 
 
Prüwasser Peter
Guest
Posts: n/a
 
      19th Dec 2006
Hello,

I want to create a DSN in Microsoft Access for MySQL.

I try it with the following Code, but it doesn't work i am always
getting the error 3146

Attr = "Description=" & Me.strDatabase & "" & Chr$(13)
Attr = Attr & "Server=" & Me.strServer & "" & Chr$(13)
Attr = Attr & "user=" & "root" & "" & Chr$(13)
Attr = Attr & "password=" & "PWD" & "" & Chr$(13)
Attr = Attr & "Port=" & "3306" & "" & Chr$(13)
Attr = Attr & "Database=" & Me.strDatabase & ""

DBEngine.RegisterDatabase "mysqlcs1", "MySQL Connector/ODBC v5", True,
Attr

Can anyone please help me??


Thanks Peter


 
Reply With Quote
 
 
 
 
Tony Toews
Guest
Posts: n/a
 
      19th Dec 2006
"Prüwasser Peter" <(E-Mail Removed)> wrote:

> I want to create a DSN in Microsoft Access for MySQL.
>
> I try it with the following Code, but it doesn't work i am always
>getting the error 3146


What's the text of the error message?

Alternatively ...I much prefer DSN-Less connections as it is one less
thing for someone to have to configure and one less thing for the
users to screw up. This is also better for Citrix/TS farms where
each individual system would have to have a DSN created and
maintained.

Using DSN-Less Connections
http://www.accessmvp.com/djsteele/DSNLessLinks.html
ODBC DSN-Less Connection Tutorial Part I
http://www.amazecreations.com/datafa...m&Article=true
HOWTO: Use "DSN-Less" ODBC Connections with RDO and DAO
http://support.microsoft.com/?id=147875
ODBC DSN Less
http://www.able-consulting.com/MDAC/...BC_DSNLess.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
Reply With Quote
 
Prüwasser Peter
Guest
Posts: n/a
 
      19th Dec 2006
Hello Tony,

The Text of the error message is: odbc call missed

I cannot use DSN Less Connections because our Program is based on DSN
Connections.
And this referrs about 28 modules!

Thanks Peter

"Tony Toews" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> "Prüwasser Peter" <(E-Mail Removed)> wrote:
>
>> I want to create a DSN in Microsoft Access for MySQL.
>>
>> I try it with the following Code, but it doesn't work i am always
>>getting the error 3146

>
> What's the text of the error message?
>
> Alternatively ...I much prefer DSN-Less connections as it is one less
> thing for someone to have to configure and one less thing for the
> users to screw up. This is also better for Citrix/TS farms where
> each individual system would have to have a DSN created and
> maintained.
>
> Using DSN-Less Connections
> http://www.accessmvp.com/djsteele/DSNLessLinks.html
> ODBC DSN-Less Connection Tutorial Part I
> http://www.amazecreations.com/datafa...m&Article=true
> HOWTO: Use "DSN-Less" ODBC Connections with RDO and DAO
> http://support.microsoft.com/?id=147875
> ODBC DSN Less
> http://www.able-consulting.com/MDAC/...BC_DSNLess.htm
>
> Tony
> --
> Tony Toews, Microsoft Access MVP
> Please respond only in the newsgroups so that others can
> read the entire thread of messages.
> Microsoft Access Links, Hints, Tips & Accounting Systems at
> http://www.granite.ab.ca/accsmstr.htm



 
Reply With Quote
 
Tony Toews
Guest
Posts: n/a
 
      19th Dec 2006
"Prüwasser Peter" <(E-Mail Removed)> wrote:

> The Text of the error message is: odbc call missed


Sorry but I have no idea.

You could try searching at groups.google.com, clicking on the Advanced
Search link and limiting your search to the comp.databases.ms-access
newsgroup and the microsoft.public.access.* newsgroups.

You may also want to ask in a MySQL newsgroup.

Do you have a URL handy for the MySQL syntax?

Should you be prefacing DBEngine with DAO or ADO?

> I cannot use DSN Less Connections because our Program is based on DSN
>Connections.
> And this referrs about 28 modules!


Then do a find and replace and fix the code. <smile> Yeah, I know
it's easy for me to say that.

Seriously though have yup experimented with that at all?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running mysql code in access =?Utf-8?B?aXRIZWluZXI=?= Microsoft Access 1 15th Feb 2006 07:05 PM
Problems with MySql Connector.Net in code behind =?Utf-8?B?S2VubmV0aCBQ?= Microsoft ASP .NET 4 7th Mar 2005 03:33 PM
frontpage add-in for MySQL / PHP code generation TB Microsoft Frontpage 8 18th Apr 2004 05:36 PM
create a table on MySQL using ODBC ans Microsoft Access VBA Modules 1 5th Mar 2004 05:19 PM
create data link with MSSQL2000 and MySql ? viviane lima - * - * - Microsoft Frontpage 1 3rd Aug 2003 04:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:11 PM.