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]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]