Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database troubles - need basic help

Status
Not open for further replies.

djrez

Technical User
Jun 4, 2004
3
0
0
US
Hello,

I am using Dreamweaver MX to interact with a Microsoft Access Database. My host told me to use ASP VBScript. That is what I used in Dreamweaver. Unfortunately, I do not know any of the supported languages yet, which is probably why I can't solve the following problem.

On my PC, everything seems to work fine. I set up the DSN situation and made a connection. When making a recordset, the test works fine and sorts the records. So I am connected ok. I put a repeating region and some dynamic text on the actual page. When pressing F12, the browser only shows a page full of code. I tried this online and on my PC. Also, I made sure to upload the supporting folder named "connections". But still, I get this in my browser instead of the database info:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<%
Dim mob_beerlist__MMColParam
mob_beerlist__MMColParam = "1"
If (Request("MM_EmptyValue") <> "") Then
mob_beerlist__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim mob_beerlist
Dim mob_beerlist_numRows

Set mob_beerlist = Server.CreateObject("ADODB.Recordset")
mob_beerlist.ActiveConnection = "dsn=dsn_maxs_beerlist;"
mob_beerlist.Source = "SELECT beer_name, alcohol FROM beer_list WHERE MOB = " + Replace(mob_beerlist__MMColParam, "'", "''") + " ORDER BY beer_name ASC"
mob_beerlist.CursorType = 0
mob_beerlist.CursorLocation = 2
mob_beerlist.LockType = 1
mob_beerlist.Open()

mob_beerlist_numRows = 0
%>
<html>
<head>
<title>Max's Beer Lists</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="100%" border="1" cellspacing="0" cellpadding="10">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><%=(mob_beerlist.Fields.Item("beer_name").Value)%></td>
<td><%=(mob_beerlist.Fields.Item("alcohol").Value)%></td>
</tr>
</table>
</body>
</html>
<%
mob_beerlist.Close()
Set mob_beerlist = Nothing
%>


It seems like the server isn't processing it or something? Maybe the support tech is wrong about the language support? What is going on? Thanks.

Tony
 
I quess that you'll need to set similar DSN on your web server or use OLEDB connection if your host does not support DSNs.
 
I'll ask the obvious questions,
Does the page does have a .asp extension? and does the host support asp scripting?

Because for that to appear in the browser the server is not processing the page as asp code but as plain text.

BTW. pressing F12 (preview) won't run the asp code. ASP code only runs when the page is located on a webserver that supports ASP scripting.



Chris.

Indifference will be the downfall of mankind, but who cares?
 
The tech that told me ASP should be working did not understand that I have a Linux account and not windows. :(

I'm just learning so I didn't understand that. I'm going to use Access to MySQL converter and make PHP pages.

I'm not quite sure but I beleive you can set Dreamweaver MX up to test pages on the server with F12 though. It puts temp files and the supporting files right on the server for the preview.

Either way, thanks for helping me out. I'm sure I'll be back when I get my hands dirty figuring out PHP and MySql. ;)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top