| Welcome to Webforumz.com. |
|
Oct 19th, 2007, 07:28
|
#1 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
MySQL Connection String Info
I have been using MySQL since few weeks ago and I got this connection string from somewhere but I could not understand the OPTION thing.
Could somebody give a brief info about this?
and one more thing, is there any LockType (like in MS Access MS SQL) in MySQL?
Thanks..
- Code: Select all
connectionString = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=mydatabase; OPTION=4; UID=root; PASSWORD=mypassword;"
__________________
|
|
|
Oct 22nd, 2007, 09:14
|
#2 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: MySQL Connection String Info
Any one? Please 
__________________
|
|
|
Oct 22nd, 2007, 10:50
|
#3 (permalink)
|
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 612
|
Re: MySQL Connection String Info
I've worked with SQL / Access for over two years now and I still don't understand the connection strings....
Maybe you can find some answers here: http://connectionstrings.com/
__________________
Web design is the creation of digital environments that facilitate and encourage human activity; reflect or adapt to individual voices and content; and change gracefully over time while always retaining their identity.
~ www.c010depunkk.com ~ the hang-out of a web developer
|
|
|
Oct 23rd, 2007, 04:16
|
#4 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: MySQL Connection String Info
Quote:
Originally Posted by c010depunkk
I've worked with SQL / Access for over two years now and I still don't understand the connection strings....
Maybe you can find some answers here: http://connectionstrings.com/
|
LOL...
That's where I learn all the connection string that I use in my page.
but, they don't include enough explanation to the connection string, like the "OPTION=4" sometimes I saw "OPTION=3", I don't understand that and I don't know if I should know that either. Maybe it is some kind of "LOCKTYPE"??
Thanks..
__________________
Last edited by Monie; Oct 23rd, 2007 at 04:18.
|
|
|
Oct 23rd, 2007, 06:41
|
#5 (permalink)
|
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 612
|
Re: MySQL Connection String Info
__________________
Web design is the creation of digital environments that facilitate and encourage human activity; reflect or adapt to individual voices and content; and change gracefully over time while always retaining their identity.
~ www.c010depunkk.com ~ the hang-out of a web developer
Last edited by c010depunkk; Oct 23rd, 2007 at 06:51.
Reason: sry, that was for SQL
|
|
|
Oct 23rd, 2007, 06:54
|
#6 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: MySQL Connection String Info
I am using MySQL v5.0.
Does your link apply to my connection string, that looks different.
- Code: Select all
connectionString = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=mydatabase; OPTION=4; UID=root; PASSWORD=mypassword;"
__________________
|
|
|
Oct 23rd, 2007, 06:57
|
#7 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: MySQL Connection String Info
I have this two kind of connection string that I always use:
Connection 1- Code: Select all
Dim connectionString,rs
connectionString= "DRIVER={MySQL ODBC 3.51 Driver}; SERVER = localhost; DATABASE=monieweb; OPTION=3; UID=root; PASSWORD=monie;"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT * FROM userlogin", connectionString, 1, 3 Connection 2- Code: Select all
Dim connectionString, conn, rs
connectionString = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=monieweb; OPTION=3 UID=root; PASSWORD=monie;"
conn.Open(connectionString)
Set rs = conn.Execute("SELECT * FROM userlogin")
and I have rs.AddNew in my code to add new record to the database.
- Code: Select all
rs.AddNew
'Put username and password in record
rs("username")=Username
rs("password")=Password
rs("fullname")=Fullname
'Save record
rs.Update The first connection will do just fine, but the second one, I got this error message:
- Code: Select all
Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
/create.asp, line 42
__________________
Last edited by Monie; Oct 23rd, 2007 at 07:57.
|
|
|
Oct 23rd, 2007, 09:21
|
#8 (permalink)
|
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 612
|
Re: MySQL Connection String Info
Well, I'm no guru, so I can't really help you further. Till now I was just applying common sense and Google on your problem
good luck....
__________________
Web design is the creation of digital environments that facilitate and encourage human activity; reflect or adapt to individual voices and content; and change gracefully over time while always retaining their identity.
~ www.c010depunkk.com ~ the hang-out of a web developer
|
|
|
Oct 23rd, 2007, 09:52
|
#9 (permalink)
|
Join Date: Jun 2007
Location: uk
Posts: 459
|
Re: MySQL Connection String Info
I have no idea what I am talking about here so please ignore me if you want but after a bit of googling I found this solution. In between connection 1 and connection 2 there should be an rs.close
|
|
|
Oct 24th, 2007, 01:48
|
#10 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: MySQL Connection String Info
Quote:
Originally Posted by dab42pat
I have no idea what I am talking about here so please ignore me if you want but after a bit of googling I found this solution. In between connection 1 and connection 2 there should be an rs.close
|
lol..
The connection will not be at the same page.
I use either one of them.
I want to perform rs.AddNew and rs.Update in my page.
It can be done only by using Connection 1.
When I use Connection 2 I get the error message.
Thanks..
__________________
|
|
|
| Thread Tools |
|
|
| 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
HTML code is Off
|
|
|
|
|
|