MySQL Connection String Info

This is a discussion on "MySQL Connection String Info" within the Classic ASP section. This forum, and the thread "MySQL Connection String Info are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 19th, 2007, 07:28
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
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;"
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Reply With Quote

  #2 (permalink)  
Old Oct 22nd, 2007, 09:14
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: MySQL Connection String Info

Any one? Please
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Reply With Quote
  #3 (permalink)  
Old Oct 22nd, 2007, 10:50
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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/
Reply With Quote
  #4 (permalink)  
Old Oct 23rd, 2007, 04:16
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: MySQL Connection String Info

Quote:
Originally Posted by c010depunkk View Post
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 Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

Last edited by Monie; Oct 23rd, 2007 at 04:18.
Reply With Quote
  #5 (permalink)  
Old Oct 23rd, 2007, 06:41
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: MySQL Connection String Info

MySql official documentation:
http://dev.mysql.com/doc/refman/5.0/...nnectionstring

Last edited by c010depunkk; Oct 23rd, 2007 at 06:51. Reason: sry, that was for SQL
Reply With Quote
  #6 (permalink)  
Old Oct 23rd, 2007, 06:54
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
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;"
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Reply With Quote
  #7 (permalink)  
Old Oct 23rd, 2007, 06:57
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
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 Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

Last edited by Monie; Oct 23rd, 2007 at 07:57.
Reply With Quote
  #8 (permalink)  
Old Oct 23rd, 2007, 09:21
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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....
Reply With Quote
  #9 (permalink)  
Old Oct 23rd, 2007, 09:52
SuperMember

SuperMember
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
  #10 (permalink)  
Old Oct 24th, 2007, 01:48
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: MySQL Connection String Info

Quote:
Originally Posted by dab42pat View Post
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..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Reply With Quote
Reply

Thread Tools

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 On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Connection string for password protected databases alexgeek Classic ASP 6 Oct 31st, 2007 15:59
PHP n MySQL connection uddin PHP Forum 1 Apr 18th, 2007 06:41
another database connection question! asp and mysql fogofogo Classic ASP 4 Dec 2nd, 2005 08:48
Connection String DSN-less gwx03 Classic ASP 11 Nov 26th, 2003 12:07
dns less connection String djaccess Classic ASP 7 Oct 5th, 2003 14:34


All times are GMT. The time now is 07:43.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43