|
| |
|
|
xterradane
Posts: 143 From: Mobile, AL USA Status: offline
|
Passing Variables - 1/28/2002 19:10:45
I have a job search results page with a hyperlink to the job details page. The hyperlink ID is being passed correctly, however, the page will not display as if it does not exist. It is passing like: JobDetails.asp?ID=10. The code which is suppose to find the details and display them is below. I am assuming there is a problem with that portion of the code since it is passing the correct parameters. <% Dim strID strID = Request("ID") Dim rsJob Set rsJob= Server.CreateObject("ADODB.Recordset") strSQL= "SELECT EMail, Resume FROM Resume WHERE ID =" & strID & ";" rsJob.Open strSQL, objConn If Not rsJob.EOF Then Response.Write "<TABLE ALIGN=""CENTER"" BORDER=""0"" WIDTH=""95%"" CELLSPACING=""1"" CELLPADDING=""4"">" &_ "<p><TR><TD WIDTH=25%"><b>E mail:</b> " & rsJob("EMail") & "</TR>" &_ " <TR><b>Resume:</b> " & replace(rsJob("Resume"),chr(10),"<br>")& "</TR>" Else Response.Write "No resume details were found" End If Response.Write "</TABLE>" rsJob.close Set rsJob = Nothing %> Thanks.
|
|
|
|
no_mac_jack
Posts: 295 From: Washington state, USA Status: offline
|
RE: Passing Variables - 1/28/2002 21:13:54
I think you just need to convert the ID that got passed from a string to an integer. Try changing this... strID = Request("ID") to this... strID = CInt(Request("ID")) And see if that works. If not, give me a holler. Good luck! ~no_mac_jack Friends don't let friends use Macs.
|
|
|
|
xterradane
Posts: 143 From: Mobile, AL USA Status: offline
|
RE: Passing Variables - 1/29/2002 18:26:14
I tried that plus several other variations. I keep getting the same error. It's a 500 Internal Server Error. Any other ideas?
|
|
|
|
no_mac_jack
Posts: 295 From: Washington state, USA Status: offline
|
RE: Passing Variables - 1/29/2002 19:33:54
Hmmm...with 500s I usually just mess around with it until it goes away. One thing you can do in Internet Explorer is go to Tools >> Internet Options >> Advanced and then UN-check the box by "Show friendly HTTP Error messages" and see if you get any more info about the error. Oh. One thing I just noticed...You never defined a connection string (objConn). You told the ADODB connection to open it, but didn't define it. Or did you just leave it out of the posted code? ~no_mac_jack Friends don't let friends use Macs.
|
|
|
|
xterradane
Posts: 143 From: Mobile, AL USA Status: offline
|
RE: Passing Variables - 1/29/2002 20:06:49
Now I am getting this error. But I am able to connect to the database and retrieve results-this is a hyperlink to gain more details. I don't get it. My objConn is an include file, so I have already Dimed and everything. Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. /ResumeDetails.asp, line 19
|
|
|
|
no_mac_jack
Posts: 295 From: Washington state, USA Status: offline
|
RE: Passing Variables - 1/29/2002 20:24:51
It still sounds like your ID from the querystring isn't getting changed to an integer. Try adding this right after you set strID... Response.Write VarType(strID) If it's an integer, it should write 2 to the page. If it doesn't, let me know what it *does* return. ~no_mac_jack Friends don't let friends use Macs.
|
|
|
|
xterradane
Posts: 143 From: Mobile, AL USA Status: offline
|
RE: Passing Variables - 1/29/2002 22:10:49
It wrote the 2, but I still have the OLE DB. Is there a way the connection string would work with the Initial Search, but not bring up the details portion for the hyperlink? Could something be wrong with my hyperlink? (It passes the correct value). 2 Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. /ResumeDetails.asp, line 20 Thank you for so much help already.
|
|
|
|
no_mac_jack
Posts: 295 From: Washington state, USA Status: offline
|
RE: Passing Variables - 1/29/2002 22:21:19
If the URL looks right, I don't think there's anything wrong with your hyperlink. Here's something to try. Put a simple SQL select in place of the one that's in there now and see if it works. ex. strSQL = "SELECT * FROM Resume" Another thing I would try is to just loose the semicolon at the end of your SQL. I don't usually use it and I remember having trouble with it one time. Let me know how that stuff works... ~no_mac_jack Friends don't let friends use Macs.
|
|
|
|
xterradane
Posts: 143 From: Mobile, AL USA Status: offline
|
RE: Passing Variables - 1/29/2002 22:24:04
Well something is wrong with my connection strings. One works and one does not. I am not going to try and figure it out tonight, but thanks for all the help. I will use the one that works. A question about this though. I have two include files with connection strings. One for job seekers and one for companies. As the include files check to see if they are logged in or not. When I loaded the page the host company had to adjust somethings to the DSN string because I had password protected the database. They created a .ldb file. Could this be the cause of some of this. What is the .ldb file? Thanks.
|
|
|
|
no_mac_jack
Posts: 295 From: Washington state, USA Status: offline
|
RE: Passing Variables - 1/29/2002 23:50:27
I don't know very much about ldb files, but here's a Microsoft explanation for you. I would gess that they are not the problem, but who knows...Let me know if there's anything I can do. ~no_mac_jack Friends don't let friends use Macs.
|
|
|
|
Spooky
Posts: 26599 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Passing Variables - 1/30/2002 0:30:18
Do you use a different connection type for each database? I assume one is OLEDB and the other is ODBC? §þððk¥ Database / DRW Q & A VP-ASP Shopping cart Spooky Login
|
|
|
|
xterradane
Posts: 143 From: Mobile, AL USA Status: offline
|
RE: Passing Variables - 1/30/2002 20:55:21
I only have one database and I used the same connection type.. OLE DB.
|
|
|
|
Spooky
Posts: 26599 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Passing Variables - 1/30/2002 22:16:01
That was my next point, if it works, dont mess with it ;) Its always a victory to get to the bottom of things though :) §þððk¥ Database / DRW Q & A VP-ASP Shopping cart Spooky Login
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|