Author |
Topic |
|
asp_storm
Average Member
USA
787 Posts |
Posted - 13 March 2002 : 20:33:00
|
i am creating an image db script and get this error:
Microsoft VBScript compilation error '800a0409'
Unterminated string constant
/images.asp, line 23
Response.Write("<img src=""<%=x.value -------------------------------------^
and here is my line 23:
<table border="1" width="100%"> <tr> <%For Each x In rs.Fields response.write("<th>" & x.name & "</th>") Next%> </tr> <%Do Until rs.EOF%> <tr> <%For Each x In rs.Fields%> <td><%Response.Write("<img src=""<%=x.value%>"">")%></td> <%Next rs.MoveNext%> </tr> <%Loop rs.close conn.close %> </table>
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 13 March 2002 : 20:54:44
|
Change the following line: <td><%Response.Write("<img src=""<%=x.value%>"">")%></td>
To: <td><img src="<%=x.value%>"></td>
Nikkol |
|
|
asp_storm
Average Member
USA
787 Posts |
Posted - 13 March 2002 : 21:50:14
|
ok..i changed the code..and now i can display a image...but i also want to display some text with it:
<html> <body> <%
dim trick dim ID dim Skier Dim url dim Photog ID=request.querystring("ID") set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open "d:\html\users\newschoolskiingcom\database\images.mdb"
set rs = Server.CreateObject("ADODB.recordset") sql="SELECT url,Photog,Skier FROM images" rs.Open sql,conn %>
<table border="1" width="100%"> <%do until rs.EOF%> <tr> <%for each x in rs.Fields%> <td>trick:<%=trick%><br><img src="/images/<%=(x.value)%>"></td> <%next rs.MoveNext%> </tr> <%loop rs.close conn.close %> </table>
</body> </html>
ie: trick is a value in the db..how can i display it where it says "trick:<%=trick%>"?
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 13 March 2002 : 22:02:57
|
Is trick a field in your images table? If so, change your sql statement to this:
sql="SELECT url,Photog,Skier,trick FROM images"
Then change your reference to trick as this:
trick: <%= rs("trick") %>
Nikkol |
|
|
asp_storm
Average Member
USA
787 Posts |
Posted - 13 March 2002 : 22:13:31
|
it worked!! thanks a lot Nikkol!
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 13 March 2002 : 22:18:30
|
Nikkol |
|
|
asp_storm
Average Member
USA
787 Posts |
Posted - 13 March 2002 : 22:20:48
|
one more thing... i want to be able to call the image by a variable...ie: ID through a querystring. now how would i make it would see the image id and get the images url?
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 13 March 2002 : 22:22:51
|
what are all the field names in your images table and what data types are they?
Nikkol |
|
|
asp_storm
Average Member
USA
787 Posts |
Posted - 13 March 2002 : 22:24:18
|
Trick,url,Photog,Skier all just the basic..i am not storing the actual image data in it..just the links to the images
|
|
|
asp_storm
Average Member
USA
787 Posts |
Posted - 13 March 2002 : 22:26:35
|
o..i forgot and ID
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 13 March 2002 : 22:27:09
|
just a note... if you were looking for a particular ID, then you could just make your sql statement: sql="SELECT url,Photog,Skier,trick FROM images WHERE ID = " & idvalue
where idvalue could be set earlier in the page, passed through the URL's query string, submitted from a form....
Nikkol |
|
|
asp_storm
Average Member
USA
787 Posts |
Posted - 13 March 2002 : 22:34:45
|
ok..i got it now..it is so simple..thanks for all your help
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 13 March 2002 : 22:35:32
|
no problem!
Nikkol |
|
|
|
Topic |
|