Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie - Where do I start??

Status
Not open for further replies.

Floodster

Technical User
Jan 28, 2005
204
Hi,
I've written my site using .ASP, Javascript and an MS Access database. I'm now looking to 'upgrade' to MySql to solve any database issues I may have in the future but I haven't a clue about MySql. My questions are;

Does it cost anything?
What do I need?
How do I transfer my tables?
Will my ASP code work on MySql?


I appreciate any help on this.
 
1. No
2. The download page: gives the download for MySQL server, and points to the tools you need:
* MySQL Migration Toolkit -- Migrate from your legacy databases
* MySQL Workbench -- A database design tool for MySQL
* MySQL Administrator -- Administer MySQL Server
* MySQL Query Browser -- Use this graphical client to work with your MySQL databases and run queries
3. See above
4. Yes - just install the MyODBC driver and change your connection string to point to it

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
So did that answer it?

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Pretty much so, do you know of any good sites that give workable examples as a start point??

Thanks.
 
Not sure if this is what your looking for...

Take a look at these sites:
(some tutorials)


As well, you should find this site helpful (bookmark it)

the above is the MySQL 5.0 refrence manual, but you can choose whichever version you are using and search the manual over the web. Great for Syntax examples and explanations.


hope that helps you.

atsea
 
your asp code will work, but you will definitely need to change some of the sql that you submit to mysql

access sql is not the same as mysql sql

that's the nice thing about sql standards, eh -- there are so many to choose from ;-)

r937.com | rudy.ca
 
I have been looking to buy a book to help me along with a start to finish guide of how to install, migrate & run mysql along with ASP but all the books seem to be titled "Learn PHP & MySql". I think if I've got to learn 2 new languages I shall go bald!!

Can anyone recommend some books for MySql & the migration kits??
The link already posted were good but weren't detailed enough for me a complete beginner for MySql.

Thanks.
 
PHP has no connection at all with MySQL, except that the two are often used together to power websites. There are several MySQL books available; "MySQL" by P. DuBois has been regarded as a standard for several years.
 
OK,
SO I've dowloaded the following;
mysql-essential-5.0.21-win32
mysql-migration-toolkit-1.0.25-win32

I've ran the setup for the 'essential' download & used the recommended settings as per the mysql reference manual.
The config file then starts to run & again chose the recommended options as per the mysql reference manual but I get an error when trying to execute it. The error is
Code:
Error Nr 1045
Access denied for user 'root@localhost' (using password:NO)
If a personal firewall is running on your machine, please make sure you have opened the TCP port 3306 for connections. Otherwise no client application can connect to the server. After you have opened the port please press (RETRY)to apply the security settings.
I have seen similar posts but I have not been able to correct this.
As I am a complete noobie to mysql it's a bit off putting that I can't even get it installed correctly.
Any ideas??

Thanks.
 
I've fixed this, it was to do with my security settings on my PC.
 
Ok then, I'm at the stage where I want to connect to my database & run a simple SELECT query, I have shown below what I currently use for ACCESS & ASP.

Connection string
Code:
Dim kDBSTRING
Dim kPATH
kDBSTRING="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="""& server.MapPath("\databases\mbdata.mdb")& """"
kPath=server.MapPath("\databases\mbdata.mdb")

ASP code;
Code:
sSql="Select id, ddate, venue, link FROM tbl_FIXTURES ORDER by dDATE ASC;"
		nStatus=fnSqlSelect( kDBSTRING, sSql, aUserResults )
		If nstatus>0 then
			'fnError("most records found")
			'fnError("most status="&nstatus)
		End If
		'no records found
		If nstatus=0 then
		sMessage=("Sorry but there are no records to display")
		End If
& finally here is my code for the function fnSqlSelect
Code:
function fnSqlSelect( byval spConnect, byval spSql, byref apResults )
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' a negative return value signals an error
' a positive return value signals number of rows selected
'
'  0 recordset empty, did not return any rows
' -1 cannot open data source
' -2 could not open recordset, possible invalid sql statement
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

dim aReturn()					' results- row 0 is field names, data starts at row 1
dim nReturn		: nReturn=0		' status indicator
dim sConnect 	: sConnect=spConnect
dim objConn		
dim objRS		

dim nRows
dim nFields

dim nRow
dim nField
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' check for database file existence before using ADO to connect to it
	redim apResults(0,0)

	set objConn=Server.CreateObject("ADODB.Connection")
	set objRS=Server.CreateObject("ADODB.Recordset")

	on error resume next
	objConn.Open sConnect
	on error goto 0

	' check if we connected
	if objConn.State<>1 then
		nReturn=-1				
		
	else
		' configure the record set
		objRS.Source			= spSql
		objRS.ActiveConnection		= objConn
		objRS.CursorType		= 0
		objRS.CursorLocation		= 3
		objRS.LockType			= 1
	
		' populate the recordset
		on error resume next
		objRS.Open
		on error goto 0
	
		' check we opened the recordset
		if objRS.State=0 then
			nReturn=-2
	
		else
			' opened a recordset, did we get any rows			
			if objRS.EOF or objRS.BOF then
				nReturn=0
				
			else
				nRows	=objRS.RecordCount
				nFields	=objRS.Fields.Count
	
				nReturn=nRows
				redim apResults( nRows, nFields )
	
				' now move through the record set filling the cache array
				nRow=1
				objRS.MoveFirst
		
				do until objRS.EOF		
		
					nField=1		
					for each objField in objRS.Fields 
						
						' load this found record into the array
						apResults( nRow, nField ) = objField.Value
					
						' next field
						nField=nField+1
					
					next
				
					' next record
					nRow=nRow+1			
					objRS.MoveNext
				
				loop
			end if
	
			objRS.Close
			objConn.Close

		end if			' recordset opened
			
		set objRS=Nothing
		set objConn=Nothing
	end if				' connected to database
		
' return the status indicator
fnSqlSelect=nReturn
end function

'******************************************************************************************************************************
'******************************************************************************************************************************
'******************************************************************************************************************************

I think I should change the connection string to;
Code:
kDBSTRING="Driver={MySql ODBC 3.51 Driver}; Server=localhost; uid=root;pwd=password database=mbdata; option3; port 3306;"

as for the rest I'm stumped, thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top