DwebPro and MS Access (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


Trandel -> DwebPro and MS Access (7/19/2006 10:37:15)

Hi,

I am trying out DwebPro as a means of running a CD version of a FP site on a laptop for demo purposes where no online link exists. It works fine with straight HTML and even FP include pages. I have done this previously without DwebPro by copying the site to CD but could not get MS Access to work. However, DwebPro simulates various server environments but does not include FP extensions - it does support Asp Classic 3 and MS Access and I want to run a page with an MS Access DRW. The suggested a DSN connection for an Access databse is as follows:

<%
DSN = "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("fpdb/IOPSA.MDB") & ";" & _
"UID=admin;PWD=;ReadOnly=1;Exclusive=1;"
Set DB_CONN = Server.CreateObject("ADODB.Connection")
DB_CONN.Open(DSN)
%>

I tried to update the global.asa DRIVER statement with this but could not get the database to actually run - I got an error msg saying this had to be an asp page - which it is of course. Does the DRW require FP extensions? Do I need to add the DB_CONN set and open statements to the global.asa?

Any advice would be most welcome as this product looks promising as I also need to run a PHP Mysql demo domain which they also support.

Regards

Tony Randell




rdouglass -> RE: DwebPro and MS Access (7/19/2006 10:41:56)

quote:

Does the DRW require FP extensions?


Yes, absolutely.




Trandel -> RE: DwebPro and MS Access (7/19/2006 11:17:53)

Guess thats the end of that then. Thanks




rdouglass -> RE: DwebPro and MS Access (7/19/2006 11:22:32)

quote:

Guess thats the end of that then.


Not necessarily. The DRW is not the only way to show DB data. You said this supports ASP, correct? How many DRW's do you have going to the demo?




Trandel -> RE: DwebPro and MS Access (7/19/2006 13:56:53)

My test site has only one but the real demo has 6

Regards

TR




rdouglass -> RE: DwebPro and MS Access (7/19/2006 14:04:08)

Are you up to the task of replacing the DRW's with ASP?




Trandel -> RE: DwebPro and MS Access (7/19/2006 14:25:45)

Happy to try - suggest we do the test site which only has one then I can iterate to the actual site?

Regards

TR




rdouglass -> RE: DwebPro and MS Access (7/19/2006 14:44:01)

I'd suggest a simple one to try with the ASP emulation. Do you have a simple DRW to post?




Trandel -> RE: DwebPro and MS Access (7/19/2006 15:07:48)

Hi,

Is this what you need:

The URL is http://www.iopsa.org.za/iopsa-find-a-plumber-result.asp

The query URL is http://www.iopsa.org.za/left-db.htm
The Global.asa for this is:

Sub Application_OnStart
'==FrontPage Generated - startspan==
Dim FrontPage_UrlVars(3)
'--Project Data Connection
Application("IOPSA_ConnectionString") = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/IOPSA.MDB"
FrontPage_UrlVars(0) = "IOPSA_ConnectionString"
Application("IOPSA_ConnectionTimeout") = 15
Application("IOPSA_CommandTimeout") = 30
Application("IOPSA_CursorLocation") = 3
Application("IOPSA_RuntimeUserName") = ""
Application("IOPSA_RuntimePassword") = ""
'--
Application("FrontPage_UrlVars") = FrontPage_UrlVars
'==FrontPage Generated - endspan==
End Sub

Hope this is what you need?


Regards

TR




rdouglass -> RE: DwebPro and MS Access (7/19/2006 15:19:01)

quote:

Do you have a simple DRW to post?


I just need the code to a simple DRW. The other stuff is unneccessary.

We're trying to get a DRW to work with your Demo builder, correct? Your Demo builder supports ASP, correct? I would need to see the DRW in order to convert it to ASP. Remeber the DRW's require FrontPage extensions and we don't have them on a CD...




Trandel -> RE: DwebPro and MS Access (7/19/2006 15:25:10)

Hi

I dont have anything less complex on this test site - do you need a copy of the source for just the DRW?

I am not sure exactly what you require ..... ?

Regards

TR

PS Am +2 hrs GMT and have to sign off for now.




rdouglass -> RE: DwebPro and MS Access (7/19/2006 15:32:38)

quote:

http://www.iopsa.org.za/iopsa-find-a-plumber-result.asp


Ideally you'd post the code of the DRW on this page and not the actual link to it. What I see is the results of the DRW and not the DRW code itself.

quote:

do you need a copy of the source for just the DRW


Yes, that's what I need.




Trandel -> RE: DwebPro and MS Access (7/20/2006 1:34:30)

Hi,

OK this is the code from the Frontpage view of the DRW for that page:


<table width="95%">
          <tbody>
                      <!--webbot bot="DatabaseRegionStart" s-columnnames="Cat,Contact,Co,Addr1,Addr2,Addr3,Addr4,Phone,Cell,Fax,OS Ind" s-columntypes="202,202,202,202,202,202,202,202,202,202,11" s-dataconnection="IOPSA" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice="Cat" s-menuvalue="Cat" b-tableborder="FALSE" b-tableexpand="TRUE" b-tableheader="FALSE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="Full_Members" s-displaycolumns="Cat,Contact,Co,Addr1,Addr2,Addr3,Addr4,Phone,Cell,Fax" s-criteria="[Addr4] BEG {FindZip} +" s-order="[Co] +" s-sql="SELECT * FROM Full_Members WHERE (Addr4 LIKE '::FindZip::%') ORDER BY Co ASC" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="FindZip=" s-norecordsfound="No IOPSA Members were found serving this area" i-maxrecords="0" i-groupsize="5" botid="1" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.</font></td></tr>" startspan b-UseDotNET="FALSE" CurrentExt sa-InputTypes="202" b-DataGridFormat="FALSE" b-DGridAlternate="TRUE" sa-CritTypes="202" b-WasTableFormat="TRUE" b-ReplaceDatabaseRegion="FALSE" --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Full_Members WHERE (Addr4 LIKE '::FindZip::%') ORDER BY Co ASC"
fp_sDefault="FindZip="
fp_sNoRecords="<tr><td colspan=10 align=""LEFT"" width=""100%"">No IOPSA Members were found serving this area</td></tr>"
fp_sDataConn="IOPSA"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="Cat"
fp_sMenuValue="Cat"
fp_sColTypes="&Cat=202&Contact=202&Co=202&Addr1=202&Addr2=202&Addr3=202&Addr4=202&Phone=202&Cell=202&Fax=202&OS Ind=11&"
fp_iDisplayCols=10
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="40940" --><tr>
              <td align="left" valign="top" colspan="3">
              <hr color="#000080" width="95%" size="1">
              </td>
            </tr>
                      <tr>
              <td align="left" valign="top">
              <p style="margin-top: 5px; margin-bottom: 5px">  
              <!--webbot bot="DatabaseResultColumn" s-columnnames="Cat,Contact,Co,Addr1,Addr2,Addr3,Addr4,Phone,Cell,Fax,OS Ind" s-column="Co" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Co<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Co")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="2397" --></p>
              <p style="margin-top: 5px; margin-bottom: 5px">  
              <!--webbot bot="DatabaseResultColumn" s-columnnames="Cat,Contact,Co,Addr1,Addr2,Addr3,Addr4,Phone,Cell,Fax,OS Ind" s-column="Addr1" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Addr1<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Addr1")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="6705" --></p>
              <p style="margin-top: 5px; margin-bottom: 5px">  
              <!--webbot bot="DatabaseResultColumn" s-columnnames="Cat,Contact,Co,Addr1,Addr2,Addr3,Addr4,Phone,Cell,Fax,OS Ind" s-column="Addr2" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Addr2<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Addr2")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="6709" --></p>
              <p style="margin-top: 5px; margin-bottom: 5px">  
              <!--webbot bot="DatabaseResultColumn" s-columnnames="Cat,Contact,Co,Addr1,Addr2,Addr3,Addr4,Phone,Cell,Fax,OS Ind" s-column="Addr3" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Addr3<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Addr3")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="6713" --></p>
              <p style="margin-top: 5px; margin-bottom: 5px">  
              <!--webbot bot="DatabaseResultColumn" s-columnnames="Cat,Contact,Co,Addr1,Addr2,Addr3,Addr4,Phone,Cell,Fax,OS Ind" s-column="Addr4" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Addr4<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Addr4")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="6717" --></td>
              <td align="right" valign="top" width="7%">
              <p style="margin-top: 5px; margin-bottom: 5px">Tel:
              </p>
              <p style="margin-top: 5px; margin-bottom: 5px">Fax: 
              </p>
              <p style="margin-top: 5px; margin-bottom: 5px">Cell:
              </td>
              <td align="left" valign="top" width="25%">
              <p style="margin-top: 5px; margin-bottom: 5px">
              <!--webbot bot="DatabaseResultColumn" s-columnnames="Cat,Contact,Co,Addr1,Addr2,Addr3,Addr4,Phone,Cell,Fax,OS Ind" s-column="Phone" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Phone<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Phone")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="8388" --></p>
              <p style="margin-top: 5px; margin-bottom: 5px"> 
              <!--webbot bot="DatabaseResultColumn" s-columnnames="Cat,Contact,Co,Addr1,Addr2,Addr3,Addr4,Phone,Cell,Fax,OS Ind" s-column="Fax" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Fax<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Fax")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="1677" --></p>
              <p style="margin-top: 5px; margin-bottom: 5px">
              <!--webbot bot="DatabaseResultColumn" s-columnnames="Cat,Contact,Co,Addr1,Addr2,Addr3,Addr4,Phone,Cell,Fax,OS Ind" s-column="Cell" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Cell<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Cell")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="3721" --></p>
              <p> </td>
            </tr>
            <tr>
              <td align="left" valign="top" colspan="3">
              <hr color="#000080" width="95%" size="1">
              </td>
            </tr>
            <!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="5" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr><TR><TD VALIGN=MIDDLE COLSPAN=64><NOBR><INPUT TYPE=Button VALUE="  |<  "><INPUT TYPE=Button VALUE="   <  "><INPUT TYPE=Button VALUE="  >   "><INPUT TYPE=Button VALUE="  >|  ">  [1/5]</NOBR><BR></td></tr>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></tbody>
        </table>

Looks a tad busy to me ?

Regards

Tony Randell





Trandel -> RE: DwebPro and MS Access (7/21/2006 2:40:44)

Hi

Was that the right information that you wanted?

Regards

TR




rdouglass -> RE: DwebPro and MS Access (7/21/2006 10:01:58)

Haven't tested it but this is what I came up with for a replacement for that DRW.

<table width="95%"> 
<% 
DSN = "DRIVER={Microsoft Access Driver (*.mdb)};" & _ 
"DBQ=" & Server.MapPath("fpdb/IOPSA.MDB") & ";" & _ 
"UID=admin;PWD=;ReadOnly=1;Exclusive=1;" 
Set DB_CONN = Server.CreateObject("ADODB.Connection") 
DB_CONN.Open(DSN)

Set RS = Server.CreateObject("ADODB.RecordSet")
RS.Open "SELECT * FROM Full_Members WHERE (Addr4 LIKE '" & Request.form("FindZip") & "%') ORDER BY Co ASC", DB_CONN

Do While Not RS.EOF
%> 
<td align="left" valign="top" colspan="3"> 
<hr color="#000080" width="95%" size="1"> 
</td> 
</tr> 
<tr> 
<td align="left" valign="top"> 
<p style="margin-top: 5px; margin-bottom: 5px">   
<%=RS("Co")%></p> 
<p style="margin-top: 5px; margin-bottom: 5px">   
<%=RS("Addr1")%></p> 
<p style="margin-top: 5px; margin-bottom: 5px">   
<%=RS("Addr2")%></p> 
<p style="margin-top: 5px; margin-bottom: 5px">   
<%=RS("Addr3")%></p> 
<p style="margin-top: 5px; margin-bottom: 5px">   
<%=RS("Addr4")%></td> 
<td align="right" valign="top" width="7%"> 
<p style="margin-top: 5px; margin-bottom: 5px">Tel: 
</p> 
<p style="margin-top: 5px; margin-bottom: 5px">Fax: 
</p> 
<p style="margin-top: 5px; margin-bottom: 5px">Cell: 
</td> 
<td align="left" valign="top" width="25%"> 
<p style="margin-top: 5px; margin-bottom: 5px"> 
<%=RS("Phone")%></p> 
<p style="margin-top: 5px; margin-bottom: 5px"> 
<%=RS("Fax")%></p> 
<p style="margin-top: 5px; margin-bottom: 5px"> 
<%=RS("Cell")%></p> 
<p> </td> 
</tr> 
<%RS.movenext%>
<tr> 
<td align="left" valign="top" colspan="3"> 
<hr color="#000080" width="95%" size="1"> 
</td> 
</tr> 
</table>


It is definitely less 'busy' but I suspect you'll have more questions. A good place to look for answers on what I posted is:

http://www.aspfaqs.com/aspfaqs/

Again I didn't test it but that should look just like the DRW does when being displayed in the browser.




Trandel -> RE: DwebPro and MS Access (7/21/2006 11:40:25)

Wow - thanks a bunch for all the effort!

I am very much a novice with ASP but I tried running the code and got an error the 'loop' was expected on line 54.

I added <%Loop%> right before the end of the table and got a but bit further but then hit a new error:

Error Type:
Microsoft OLE DB Service Components (0x80040E73)
Format of the initialization string does not conform to the OLE DB specification.
/IOPSAnew_cd/iopsa-find-a-plumber-result-NODRW.asp, line 15

At which point I gave up as I was getting into murky waters and could be causing more errors.

I hesitate to ask for more help - but any ideas welcome.

The code generated by FP with just your code inserted is:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Tel</title>
</head>

<body>
<table width="95%"> 
<% 
DSN = "DRIVER={Microsoft Access Driver (*.mdb)};" & _ 
"DBQ=" & Server.MapPath("fpdb/IOPSA.MDB") & ";" & _ 
"UID=admin;PWD=;ReadOnly=1;Exclusive=1;" 
Set DB_CONN = Server.CreateObject("ADODB.Connection") 
DB_CONN.Open (DSN)

Set RS = Server.CreateObject("ADODB.RecordSet")
RS.Open "SELECT * FROM Full_Members WHERE (Addr4 LIKE '" & Request.form("FindZip") & "%') ORDER BY Co ASC", DB_CONN

Do While Not RS.EOF
%> 
<td align="left" valign="top" colspan="3"> 
<hr color="#000080" width="95%" size="1"> 
</td> 
</tr> 
<tr> 
<td align="left" valign="top"> 
<p style="margin-top: 5px; margin-bottom: 5px">   
<%=RS("Co")%></p> 
<p style="margin-top: 5px; margin-bottom: 5px">   
<%=RS("Addr1")%></p> 
<p style="margin-top: 5px; margin-bottom: 5px">   
<%=RS("Addr2")%></p> 
<p style="margin-top: 5px; margin-bottom: 5px">   
<%=RS("Addr3")%></p> 
<p style="margin-top: 5px; margin-bottom: 5px">   
<%=RS("Addr4")%></td> 
<td align="right" valign="top" width="7%"> 
<p style="margin-top: 5px; margin-bottom: 5px">Tel: 
</p> 
<p style="margin-top: 5px; margin-bottom: 5px">Fax: 
</p> 
<p style="margin-top: 5px; margin-bottom: 5px">Cell: 
</td> 
<td align="left" valign="top" width="25%"> 
<p style="margin-top: 5px; margin-bottom: 5px"> 
<%=RS("Phone")%></p> 
<p style="margin-top: 5px; margin-bottom: 5px"> 
<%=RS("Fax")%></p> 
<p style="margin-top: 5px; margin-bottom: 5px"> 
<%=RS("Cell")%></p> 
<p> </td> 
</tr> 
<%RS.movenext%>
<tr> 
<td align="left" valign="top" colspan="3"> 
<hr color="#000080" width="95%" size="1"> 
</td> 
</tr> 
<%Loop%>
</table>

</body>

</html>


Regards

Tony Randell





rdouglass -> RE: DwebPro and MS Access (7/21/2006 12:06:33)

I was using the DSN that you posted. That is where the error is coming from..

Where specifically is your DB and what is it's name?




Trandel -> RE: DwebPro and MS Access (7/21/2006 14:17:09)

Hi

Its in the root at fpdb/IOPSA.MDB - so I thought it would pick up when I previewed the published site on my IIS system where I test published versions of my sites.

The full URL on my test IIS site for this page is http://dell/IOPSAnew_cd/iopsa-find-a-plumber-result-NODRW.asp and the db is at http://dell/IOPSAnew_cd/fpdb/IOPSA.MDB

Regards

T R




rdouglass -> RE: DwebPro and MS Access (7/21/2006 14:22:40)

quote:

DSN = "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("fpdb/IOPSA.MDB") & ";" & _
"UID=admin;PWD=;ReadOnly=1;Exclusive=1;"
Set DB_CONN = Server.CreateObject("ADODB.Connection")
DB_CONN.Open (DSN)


Try replacing all of that with this:

...
DSN ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("/fpdb/IOPSA.mdb")
Set DB_CONN = Server.CreateObject("ADODB.Connection")
DB_CONN.Open (DSN)
....


That help any?




Trandel -> RE: DwebPro and MS Access (7/21/2006 14:53:46)

Hi,

Now getting a new msg :

Error Type:
Microsoft JET Database Engine (0x80004005)
'c:\inetpub\wwwroot\fpdb\IOPSA.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
/IOPSAnew_cd/iopsa-find-a-plumber-result-NODRW.asp, line 13

I ran from the published URL but the error is showing the disk based URL??

Regards

T R




Trandel -> RE: DwebPro and MS Access (7/21/2006 14:57:59)

Hi,

Am having to sign off now - 8.37 pm in Johannesburg ....

Will follow up in the a.m.

Thanks again for your trouble.

Regards

T R




Trandel -> RE: DwebPro and MS Access (7/23/2006 2:56:53)

Hi,

Two thoughts on current error:

o Should I delete the existing global.asa? I tried a rename but it had no effect.

o Should the database properties in the site options in Frontpage be changed in any way?

Regards

TR




Trandel -> RE: DwebPro and MS Access (7/23/2006 7:20:48)

quote:

...
DSN ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("/fpdb/IOPSA.mdb")
Set DB_CONN = Server.CreateObject("ADODB.Connection")
DB_CONN.Open (DSN)
....


Hi,

I removed the ' / ' in front of fpdb as above and it worked. So now I have a working example of how to bring in a recordset from an Access database.

I presume we can put the connection above into the global.asa so that it can be used throughout the site whenever I want to connect to that database?

Will try some serious testing with DwebPro ...........

Thanks and Regards




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.09375