From the location you appear to be running localhost in IIS under FP in a subweb named webap
- if not running localhost (
http://localhost/webap/ your ASP won't work
You need the DB in a folder w/ appropriate permissions (you have it in the root of the subweb webap)
Open your FP subweb
Select sample.mdb & File export it to your desktop, then delete it from the FP subweb
The File Import it into your subweb and let FP put it in the fpdb folder and set up the required permissions and set up your
global.asa
Check the DB connect in Tools Site Settings Database
Look in global.asa and you will see the correct connection string as something like
Application("yourdbname_ConnectionString")
Then replace
Set cn = Server.CreateObject("ADODB.Connection")
cn.Provider = "MicroSoft.jet.OLEDB.4.0"
cn.Open "C:\Inetpub\wwwroot\webap\sample.mdb"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Friends",cn,3,3
With
cn_Name = Application("yourdbname_ConnectionString")
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "Friends", cn_Name, 3 ,3
Suggest you review SQL and ADO DB connections at
http://www.w3schools.com/default.asp
--
_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________
|
| hi stefan
|
| i am getting the following error message when i run the page
|
| "Microsoft JET Database Engine (0x80004005)
| The Microsoft Jet database engine cannot open the file
| 'C:\Inetpub\wwwroot\webap\sample.mdb'. It is already opened exclusively by
| another user, or you need permission to view its data.
| /webap/default1.asp, line 71"
|
| this is my connection string
|
| <%
|
| Dim cn,rs,sql
|
| Set cn = Server.CreateObject("ADODB.Connection")
| Set rs = Server.CreateObject("ADODB.Recordset")
|
|
| cn.Provider = "MicroSoft.jet.OLEDB.4.0"
| cn.Open "C:\Inetpub\wwwroot\webap\sample.mdb"
| rs.Open "Friends",cn,3,3
|
|
| Response.Write "<Table width=400>"
| Response.Write "<TR>"
| Response.Write "<TD><b>Info</b></TD><TD><b>First Name</b></TD>"
| Response.Write "<TD><b>Last Name</b></TD><TD><b>Email</b></TD>"
| Response.Write "</TR>"
|
| Do While Not rs.EOF
| Response.Write "<TR>"
| Response.Write rs("Name") & """>Info</a></td>"
| Response.Write "<TD>" & rs("Link") & "</TD><TD>"
| Response.Write "</TR>"
| Rs.MoveNext
| Loop
|
| Response.Write "</Table>"
|
|
| %>
|
|
| since i have closed the database i am getting this error.please help me to
| correct the code.
|
|
| Thanks & regards
| Niyaz
|
| "Stefan B Rusynko" wrote:
|
| > Invalid syntax
| > See
http://www.w3schools.com/asp/default.asp
| >
| > If Date() => Cdate("2/23/2006") AND Data() <= Cdate("2/28/2006") Then
| > 'show data from table_currentdata .
| > ElseIf Date() => Cdate("2/29/2006") AND Data() <= Cdate("3/29/2006") Then
| > 'show data from table_newdata
| > Else
| > 'show something else or error message
| > End If
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| >
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > _____________________________________________
| >
| >
| > | hi
| > |
| > | i am new to asp programming, actually i am trying to create a dynamic asp
| > | page in which the contents that i am showing in the page must change
| > | according to the date i have given in the program..
| > | like this:
| > |
| > | i am using MS-access database,, Asp
| > |
| > | if date is "23/2/2006 to 28/2/2006" show data from table_currentdata .
| > |
| > | else
| > |
| > | if date " 29/2/2006 between 29/3/2006" then show data from table_newdata
| > |
| > |
| > | endif
| > |
| > | please help me with the coding for this condition.
| > |
| > | regards
| > | Riyaz
| > |
| > | (e-mail address removed)
| >
| >
| >