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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening recordset problem

Status
Not open for further replies.

RickyP

Programmer
May 12, 2003
2
US
This code works:
Dim Conn
Dim rsType
Dim strType
Dim Count
Dim SQL

Set Conn = Server.CreateObject("ADODB.Connection")
Set rsType = Server.CreateObject("ADODB.Recordset")

Conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\\premfs7\sites\premium2\blossomhandbags\database\blossom.mdb;" & _
"Persist Security Info=False"
Conn.Open

strType = Request.QueryString("Type")'what did they click?
SQL = "SELECT ITEMMAST.Type, ITEMMAST.Fabric " & _
"FROM ITEMMAST " & _
"GROUP BY ITEMMAST.Type, ITEMMAST.Fabric " & _
"HAVING (((ITEMMAST.Type)='" & strType & "'));"

rsType.Open SQL, Conn, , , 0

Count = 0

===========================================================
THIS CODE DOESN'T, and I have no idea why. They are basically the same. The above code is first and it calls the below code when they click on a link.

Dim Conn
Dim rsAvailSize
Dim strType
Dim strFabric
Dim SQL

Set Conn = Server.CreateObject("ADODB.Connection")
Set rsAvailSize = Server.CreateObject("ADODB.Recordset")

Conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\\premfs7\sites\premium2\blossomhandbags\database\blossom.mdb;" & _
"Persist Security Info=False"
Conn.Open

strType = Request.QueryString("Type")'what did they click?
strFabric= Request.QueryString("Fabric")'what did they click?

SQL = "SELECT Size FROM ITEMMAST where Type ='" & strType & "';"

rsAvailSize.Open SQL, Conn, , , 0



 
did u try runing the query against databse and seeing i u returned anything?
SELECT Size FROM ITEMMAST where Type = strType( some hardcoded value)
 
Yeah. Both queries return values in Access. But the second one gives and internal error 500.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top