I have done the following code, which seem to partially work. I got my HTML ALT (text) from the database shown, but for some reason cannot display the image.
Below is my connection code:
<%
Dim SurveyID
SurveyID = request("SurveyID")
set dbConnection = Server.CreateObject("ADODB.Connection")
fileType = "Driver={Microsoft Access Driver (*.mdb)};"
fileLocation="DBQ=" & Server.MapPath("PPPCdb/PPPC_Database.mdb")
myString = fileType & fileLocation
call dbConnection.Open(myString)
sqlQuery="SELECT * FROM [Question] WHERE Ques_SurveyID = '" & SurveyID & "'"
set PPPCRecordset = Server.CreateObject("ADODB.Recordset")
call PPPCRecordset.Open(sqlQuery, dbConnection)
%>
My program name is PPPCSurvey4.asp
The Field name for the image is - Ques_Picture
The Field name for the ALT text is - Ques_Desc
The code I am having problems with is below:
<img src="PPPCdb/PPPC_Database.mdb/<%= PPPCRecordset("Ques_Picture")%>" width="561" height="436" alt="<%= PPPCRecordset ("Ques_Desc")%>">
Could someone explain why I am getting the following error, and how I could resolve it? I would really appreciate some help.
Below is my error message:
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.
--------------------------------------------------------------------------------
Please try the following:
Click the Refresh button, or try again later.
Open the localhost home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services
--------------------------------------------------------------------------------
Technical Information (for support personnel)
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xf0c Thread 0x8b4 DBC 0xbbf8e4 Jet'.
/PPPCWebsite/PPPCSurvey4.asp, line 12
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1)
Page:
GET /PPPCWebsite/PPPCSurvey4.asp
Time:
Saturday, October 07, 2006, 4:00:52 PM
More information:
Microsoft Support