I am not sure if this will work in VBA but an you try this?
connectionString = "Driver={MySQL ODBC 3.51
Driver};server=localhost;DB=redpath-lims;UID=;PWD="
Dim mysqlRS As New ADODB.Recordset
Set mysqlRS = New ADODB.Recordset
mysqlRS.ActiveConnection = connectionString
mysqlRS.Open "SELECT * FROM items"
-----Original Message-----
From: Eric Ellsworth
To: Victor Pendleton
Cc: '[EMAIL PROTECTED] '
Sent: 5/12/04 2:11 PM
Subject: Re: DSNless connection under DAO
Yes - the problem occurs inside the OpenDatabase call, which
unfortunately is a native
VBA function, so I can't debug it. Calling OpenConnection also prompts
this dialog to come up.
EE
Victor Pendleton wrote:
>Have you tried stepping through this code to see why the application is
>prompting you with the ODBC dialog box?
>
>-----Original Message-----
>From: Eric Ellsworth
>To: [EMAIL PROTECTED]
>Sent: 5/12/04 11:29 AM
>Subject: DSNless connection under DAO
>
>Hi,
> I am using Microsoft Access to connect to MySQL 4.0.13-nt on my
>local machine. I want to use a DSNless
>connection make sure users don't connect with more privileges than they
>should have. When I run the code below, I always get the ODBC data
>source dialog box. How can I suppress this dialog box and just
connect?
>
>Thanks,
>
>Eric
>
>
> Dim dbMySQL As Database
> Dim cnMySQL As DAO.Connection
> Dim sDSN As String
> sDSN = "ODBC;DRIVER={MySQL ODBC 3.51 Driver};" _
> & "SERVER=127.0.0.1;" _
> & " DATABASE=redpath-lims;" _
> & "UID=" & sUsername & ";PWD=" & sPW &
>";OPTION=16386"
> Set dbMySQL = OpenDatabase("", dbDriverNoPrompt, , sDSN)
> Dim rsItems As DAO.Recordset
> Dim sItemsSQL As String
> sPatientSQL = "SELECT * FROM items;"
> Set rsPatients = cnMySQL.OpenRecordset(sItemSQL)
> With rsItems
> .AddNew
> !ItemName = "Item"
> !ItemDesc = "Test"
> .Update
> Debug.Print !patientID
> End With
>
>
>
>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]