| | |
ASP file with database connection problem
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2006
Posts: 5
Reputation:
Solved Threads: 0
Hi 
I would expect to see an image from the database with that code:
<%
set conn=server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.jet.OLEDB.4.0"
conn.Open "F:/projet/test1.mdb"
set rs= conn.Execute("SELECT photo FROM photos where ID=1")
Response.ContentType="image/jpg"
Response.BinaryWrite(rs("photo"))
conn.Close
%>
or
with dsn(data source name) link in contral panel
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "WinConnection"
set rs= conn.Execute("SELECT photo FROM photos where ID=1")
Response.ContentType="image/jpg"
Response.BinaryWrite(rs("photo"))
conn.Close
%>
The only thing I get is a tons of ascii code
Anyone can help me on this ?
I get another problem
When Im doing a refresh 3 or 4 times on that asp page there is a messagebox with prompts as follows:
==================================
Title: File Download - Security Warning
Name: Setup.exe
From: localhost
Buttons: [Run] [Save] [Cancel]
While files from internet can be useful, this file type can potentially harm your computer. If you do not trust the source, do not run or save this software. (link: ) What's the risk?
================================
When i copy paste the code in a new asp file
it works like 3 or 4 times (doing some refresh) and then the messagebox come back
I tried to change security level for intranet too, but i don't know which parameter to change.
I tried with Firefox and Opera and the same problem happens.
thanx
Chris

I would expect to see an image from the database with that code:
<%
set conn=server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.jet.OLEDB.4.0"
conn.Open "F:/projet/test1.mdb"
set rs= conn.Execute("SELECT photo FROM photos where ID=1")
Response.ContentType="image/jpg"
Response.BinaryWrite(rs("photo"))
conn.Close
%>
or
with dsn(data source name) link in contral panel
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "WinConnection"
set rs= conn.Execute("SELECT photo FROM photos where ID=1")
Response.ContentType="image/jpg"
Response.BinaryWrite(rs("photo"))
conn.Close
%>
The only thing I get is a tons of ascii code
Anyone can help me on this ?
I get another problem
When Im doing a refresh 3 or 4 times on that asp page there is a messagebox with prompts as follows:
==================================
Title: File Download - Security Warning
Name: Setup.exe
From: localhost
Buttons: [Run] [Save] [Cancel]
While files from internet can be useful, this file type can potentially harm your computer. If you do not trust the source, do not run or save this software. (link: ) What's the risk?
================================
When i copy paste the code in a new asp file
it works like 3 or 4 times (doing some refresh) and then the messagebox come back
I tried to change security level for intranet too, but i don't know which parameter to change.
I tried with Firefox and Opera and the same problem happens.
thanx
Chris
![]() |
Similar Threads
- Asp.net-Database Insert problem (ASP.NET)
- Problem with database connection (JSP)
- Can I run an ASP file from a Java Applet Button? (Java)
- Connection problem (MySQL)
- Internet connection problem (Windows NT / 2000 / XP)
- Connection Problems (Networking Hardware Configuration)
Other Threads in the ASP Forum
- Previous Thread: Visual interdev Problem
- Next Thread: Asp Connection idea
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7





