Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MaxDB - Everything about MaxDB, formerly known as SAP DB
MySQL++ - Programming with the C++ API to MySQL
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
ODBC - ODBC with the MySQL Connector/ODBC driver
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
Error Code 3709

Error Code 3709

2006-03-20       - By Vic Spainhower

 Back
Reply:     1     2     3     4     5  

Hello,

I have a MySQL database on a remote host that I am connecting to using
MyODBC version 3.51.11 and MS Access 2002.  I just moved this dataabase from
a Windows host to a Linux host and now I'm have trouble on client machines
creating a recordset. I have no problem on any of 5 different machines in my
office but I'm getting the error on a number of my clients computers in
other locations.  I am not able to reproduce the error so I'm having a heck
of a time tryiing to resolve the problem. I installed MyODBC 3.51.12 and got
the same results. I have indicated and highlighted the error that is
occuring and where it occurs in the following code sample.

The error occurs on the rs.open in the following code. I would appreciate
some help in why this may be occuring as I am fresh out of ideas on why this
is happening.

Thanks very much

Vic

   Dim objRsShows  As ADODB.Recordset
   Dim conn As ADODB.Connection    
   Set conn = New ADODB.Connection
   On Error GoTo ErrorHandler


   Set objRsShows = New ADODB.Recordset
   objRsShows.ActiveConnection = CurrentProject.Connection
   objRsShows.CursorType = adOpenForwardOnly
   objRsShows.LockType = adLockOptimistic
   objRsShows.Open ("Select WebLoginName, WebPassword From tblEventMaster")


   conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
           & "SERVER=www.dbhost.com;" _
           & "DATABASE=myDatabase;" _
           & "UID=myUID;" _
           & "PWD=myPW;" _
           & "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384

   conn.CursorLocation = adUseClient
   conn.Open
   Dim rs As ADODB.Recordset
   Set rs = New ADODB.Recordset
   
   If IsNull(objRsShows.Fields("WebLoginName")) _
       Or IsNull(objRsShows.Fields("WebPassword")) Then
       MsgBox "Please supply Web Site Logon Information!", vbCritical,
"Show Secretary"
       Exit Sub
   End If


   ' ***  The following statement produces the error code 3709 "The
connection cannot be used to perform this operation. It is either closed or
invalid in this context.    

   rs.Open "SELECT LoginName, UserPassword FROM user WHERE LoginName = '" &
objRsShows.Fields("WebLoginName") & "'", conn, adOpenStatic,
adLockOptimistic
   MsgBox "recordset created", vbInformation, "Show Secretary"



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE id=ridTitle>Clear Day</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<STYLE>BODY {
  MARGIN-TOP: 25px; FONT-SIZE: 10pt; MARGIN-LEFT: 10px; COLOR: #0033cc; FONT
-FAMILY: Arial, Helvetica
}
</STYLE>

<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY id=ridBody background=cid:875214920@(protected)>
<P><SPAN class=875214920-20032006>Hello,</SPAN></P>
<P><SPAN class=875214920-20032006>I have a MySQL database on a remote host that
I am connecting to using MyODBC version 3.51.11 and MS Access 2002.&nbsp;&nbsp
;I
just moved this dataabase from a Windows host to a Linux host and now I'm have
trouble on client machines creating a recordset. I have no problem on any of 5
different machines in my office but I'm getting the error on a number of my
clients computers in other locations.&nbsp; I am not able to reproduce the
error
so I'm having a heck of a time tryiing to resolve the problem. I installed
MyODBC 3.51.12 and got the same results. I have indicated and highlighted the
error that is occuring and where it occurs in the following code
sample.</SPAN></P>
<P><SPAN class=875214920-20032006>The error occurs on the rs.open in the
following code. I would appreciate some help in why this may be occuring as I
am
fresh out of ideas on why this is happening.</SPAN></P>
<P><SPAN class=875214920-20032006>Thanks very much</SPAN></P>
<P><SPAN class=875214920-20032006>Vic</SPAN></P>
<P><SPAN class=875214920-20032006><FONT color=#000000>&nbsp;&nbsp;&nbsp; Dim
objRsShows&nbsp;&nbsp;As ADODB.Recordset<BR>&nbsp;&nbsp;&nbsp; Dim conn As
ADODB.Connection&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp; Set conn = New
ADODB.Connection<BR></FONT></SPAN><FONT color=#000000><SPAN
class=875214920-20032006>&nbsp;&nbsp;&nbsp; On Error GoTo
ErrorHandler<BR></SPAN></FONT><SPAN class=875214920-20032006><FONT
color=#000000></FONT></SPAN></P>
<P><SPAN class=875214920-20032006><FONT color=#000000>&nbsp;&nbsp;&nbsp; Set
objRsShows = New ADODB.Recordset<BR>&nbsp;&nbsp;&nbsp;
objRsShows.ActiveConnection = CurrentProject.Connection<BR>&nbsp;&nbsp;&nbsp;
objRsShows.CursorType = adOpenForwardOnly<BR>&nbsp;&nbsp;&nbsp;
objRsShows.LockType = adLockOptimistic<BR>&nbsp;&nbsp;&nbsp; objRsShows.Open
("Select WebLoginName, WebPassword From tblEventMaster")<BR></P></FONT></SPAN>
<P><SPAN class=875214920-20032006><FONT color=#000000>&nbsp;&nbsp;&nbsp;
conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};"
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;
"SERVER=www.dbhost.com;"
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;
"DATABASE=myDatabase;"
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;
"UID=myUID;"
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;
"PWD=myPW;"
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;
"OPTION=" &amp; 1 + 2 + 8 + 32 + 2048 + 16384</FONT></SPAN></P>
<P><SPAN class=875214920-20032006><FONT color=#000000>&nbsp;&nbsp;&nbsp;
conn.CursorLocation = adUseClient<BR>&nbsp;&nbsp;&nbsp;
conn.Open<BR>&nbsp;&nbsp;&nbsp; Dim rs As ADODB.Recordset<BR>&nbsp;&nbsp;&nbsp;
Set rs = New ADODB.Recordset<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;
If IsNull(objRsShows.Fields("WebLoginName"))
_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Or
IsNull(objRsShows.Fields("WebPassword"))
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox "Please supply Web
Site Logon Information!", vbCritical, "Show
Secretary"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit
Sub<BR>&nbsp;&nbsp;&nbsp; End If<BR></FONT></SPAN></P>
<P><SPAN class=875214920-20032006><FONT color=#000000>&nbsp;<FONT
color=#0000ff>&nbsp;<STRONG>&nbsp;&nbsp;' ***&nbsp; The following statement
produces the error code 3709 "The connection cannot be used to perform this
operation. </STRONG></FONT></FONT></SPAN><SPAN class=875214920-20032006><FONT
color=#000000><FONT color=#0000ff><STRONG>It is either closed or invalid in
this
context.</STRONG></FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN></P>
<P><SPAN class=875214920-20032006></SPAN><SPAN class=875214920-20032006><FONT
color=#000000>&nbsp;&nbsp;&nbsp; rs.Open "SELECT LoginName, UserPassword FROM
user WHERE LoginName = '" &amp; objRsShows.Fields("WebLoginName") &amp; "'",
conn, adOpenStatic, adLockOptimistic<BR>&nbsp;&nbsp;&nbsp; MsgBox "recordset
created", vbInformation, "Show Secretary"<BR></FONT></P></SPAN></BODY></HTML>