PDA

View Full Version : Recordset Problem


malhyp
12-20-2005, 08:35 AM
I know this must be so easy but I keep getting the wrong output.

I have a LOGIN PAGE, LOGGED IN PAGE and an ACCESS DATABASE.

When you login, a message should come up and say, "Good evening Mally"

Instead when you login, a message comes up saying,

"Good evening
ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/html/search.asp, line 272"

Line 272 reads

<%=(Recordset1.Fields.Item("ChristianName").Value)%>

I have a recordset in the LOGGED IN PAGE,

SELECT ChristianName
FROM tblUsers
WHERE ChristianName = 'MMColParam'

MMColParam 1 Session("ChristianName")

Any suggestions?

davidj
12-20-2005, 09:16 AM
not sure about syntax as you have spaces in ..

MMColParam 1 Session("ChristianName")

but i have noticed your setting the session var after the recordset has run

try setting the var first...


MMColParam 1 Session("ChristianName")

SELECT ChristianName
FROM tblUsers
WHERE ChristianName = 'MMColParam'

malhyp
12-20-2005, 09:25 AM
Hm, I tried that and it didnt work, the SQL shown above is from the recordset in Dreamweaver. This is the Code that it translates to.

Recordset1.Source = "SELECT ChristianName FROM tblUsers WHERE ChristianName = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"

davidj
12-20-2005, 09:31 AM
please post your entire code that the recordset relates to

include all vars

davidj
12-20-2005, 09:35 AM
also is your field contents getting passed

<%=(Recordset1.Fields.Item("ChristianName").Value)%>

is ChristianName the name of your field

malhyp
12-20-2005, 09:41 AM
Do you mean is it being passed from my LOGIN page to the LOGGED IN page?

I dont have a recordset in my LOGIN page for the ChristianName.

davidj
12-20-2005, 11:00 AM
where ever you form field is and your recordset is

try echo-ing the var that you set to the page (response.write i think in ASP) to see if it is being set correctly


example...

MMColParam 1 Session("ChristianName")

response.write MMColParam;

SELECT ChristianName
FROM tblUsers
WHERE ChristianName = 'MMColParam'

forgive my lack of asp knowledge. i am trying to translate into PHP as i go