Groups | Blog | Home
all groups > inetserver asp db > july 2006 >

inetserver asp db : MySQL Database Connections


James Jones
7/28/2006 10:07:49 PM
I was wondering if i can create 2 server objects for my MySQL database. =
here is my code:


<!--#INCLUDE FILE=3D"connection.asp"-->
<%
catID =3D Request.QueryString("catID")
SQL_Get_Products =3D "Select catID, prodID, prod_price, =
prod_title, prod_img_url FROM products WHERE catID =3D '" & catID & "'"
rs.Open SQL_Get_Products , conn
SQL_Get_Categories =3D "Select * FROM categories WHERE =
parent_cat =3D '" & catID & "'"
rs2.Open SQL_Get_Categories , conn
%>



Connection.asp:



<%
server2 =3D "XXXXXXXXX"
database =3D "XXXXXXXXXXX"
username =3D "XXXXXXXXXXXX"
password =3D "XXXXXXXXXXXX"
sConnection =3D "DRIVER=3D{MySQL ODBC 3.51 Driver}; SERVER=3D" & server2 =
& "; DATABASE=3D" & database & "; UID=3D" & username & ";PASSWORD=3D" & =
password & "; OPTION=3D3"
Set Conn =3D Server.CreateObject("ADODB.Connection")
Conn.Open(sConnection)
set rs =3D Server.CreateObject("ADODB.recordset")
set rs2 =3D Server.CreateObject("ADODB.recordset")
%>







My error is:


Microsoft VBScript runtime error '800a01a8'=20

Object required: ''=20

/shoppingcart/index.asp, line 74=20











can anyone help me? PLEASE!!! i need to get one field out of one table, =
and all the rest out of the other.......





Thanks,

James Jones
7/28/2006 10:45:00 PM
also i tried this:



<%
catID =3D Request.QueryString("catID")
SQL_Get_Products =3D "SELECT products.catID, =
products.prodID, products.prod_price, products.prod_title, =
products.prod_img_url, categories.catID FROM products, categories WHERE =
products.catID =3D '" & catID & "'"
rs.Open SQL_Get_Products , conn
%>


all records are displayed 2 times each....not sure whyl.
[quoted text, click to view]
I was wondering if i can create 2 server objects for my MySQL =
database. here is my code:


<!--#INCLUDE FILE=3D"connection.asp"-->
<%
catID =3D Request.QueryString("catID")
SQL_Get_Products =3D "Select catID, prodID, prod_price, =
prod_title, prod_img_url FROM products WHERE catID =3D '" & catID & "'"
rs.Open SQL_Get_Products , conn
SQL_Get_Categories =3D "Select * FROM categories WHERE =
parent_cat =3D '" & catID & "'"
rs2.Open SQL_Get_Categories , conn
%>



Connection.asp:



<%
server2 =3D "XXXXXXXXX"
database =3D "XXXXXXXXXXX"
username =3D "XXXXXXXXXXXX"
password =3D "XXXXXXXXXXXX"
sConnection =3D "DRIVER=3D{MySQL ODBC 3.51 Driver}; SERVER=3D" & =
server2 & "; DATABASE=3D" & database & "; UID=3D" & username & =
";PASSWORD=3D" & password & "; OPTION=3D3"
Set Conn =3D Server.CreateObject("ADODB.Connection")
Conn.Open(sConnection)
set rs =3D Server.CreateObject("ADODB.recordset")
set rs2 =3D Server.CreateObject("ADODB.recordset")
%>







My error is:


Microsoft VBScript runtime error '800a01a8'=20

Object required: ''=20

/shoppingcart/index.asp, line 74=20











can anyone help me? PLEASE!!! i need to get one field out of one =
table, and all the rest out of the other.......





Thanks,

James Jones
7/29/2006 12:26:50 AM
nvm.......i finally got it workin rite..............
[quoted text, click to view]
also i tried this:



<%
catID =3D Request.QueryString("catID")
SQL_Get_Products =3D "SELECT products.catID, =
products.prodID, products.prod_price, products.prod_title, =
products.prod_img_url, categories.catID FROM products, categories WHERE =
products.catID =3D '" & catID & "'"
rs.Open SQL_Get_Products , conn
%>


all records are displayed 2 times each....not sure whyl.
[quoted text, click to view]
I was wondering if i can create 2 server objects for my MySQL =
database. here is my code:


<!--#INCLUDE FILE=3D"connection.asp"-->
<%
catID =3D Request.QueryString("catID")
SQL_Get_Products =3D "Select catID, prodID, prod_price, =
prod_title, prod_img_url FROM products WHERE catID =3D '" & catID & "'"
rs.Open SQL_Get_Products , conn
SQL_Get_Categories =3D "Select * FROM categories WHERE =
parent_cat =3D '" & catID & "'"
rs2.Open SQL_Get_Categories , conn
%>



Connection.asp:



<%
server2 =3D "XXXXXXXXX"
database =3D "XXXXXXXXXXX"
username =3D "XXXXXXXXXXXX"
password =3D "XXXXXXXXXXXX"
sConnection =3D "DRIVER=3D{MySQL ODBC 3.51 Driver}; SERVER=3D" & =
server2 & "; DATABASE=3D" & database & "; UID=3D" & username & =
";PASSWORD=3D" & password & "; OPTION=3D3"
Set Conn =3D Server.CreateObject("ADODB.Connection")
Conn.Open(sConnection)
set rs =3D Server.CreateObject("ADODB.recordset")
set rs2 =3D Server.CreateObject("ADODB.recordset")
%>







My error is:


Microsoft VBScript runtime error '800a01a8'=20

Object required: ''=20

/shoppingcart/index.asp, line 74=20











can anyone help me? PLEASE!!! i need to get one field out of one =
table, and all the rest out of the other.......





Thanks,

AddThis Social Bookmark Button