×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Frontpage/ASP creating a manual connection to an Access database.

Frontpage/ASP creating a manual connection to an Access database.

Frontpage/ASP creating a manual connection to an Access database.

(OP)
I need some help with creating a manual connection to an Access database within Frontpage. I've created a simple ASP to accept a name and email address with buttons to subscribe(add) or unsubscribe(delete).

I have the page working perfectly outside the Frontpage software using IIS and a DSNless connection. The database is adding and deleting records perfectly.

I've tried variations of connecting to the database as you will see commented out. I created a connection using the database wizard in FrontPage and then used the "Application" connection string from the global.asa that FrontPage creates. That doesn't work either. Nothing seems to be working to connect.

Here are some of the things I've tried:

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
<%
Function OpenDatabase()
Set oConn = Server.CreateObject("ADODB.Connection")

'**Use Application connection string from Global.asa
'Application("vwNEWsclients_ConnectionString") = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=fpdb/vwNEWSclients.mdb"
'oConn.Open Application("vwNEWsclients_ConnectionString")

'**Providers
Provider = "Provider=Microsoft.Jet.OLEDB.4.0;"

'Provider = "DRIVER={Microsoft Access Driver (*.mdb)};"

'**Paths
'Path = "DBQ=URL=fpdb/vwNEWSclients.mdb"

Path = "DBQ=URL=" & Server.MapPath("fpdb/vwNEWSclients.mdb") & ";'

'Path = "Data Source=fpdb/vwNEWSclients.mdb"'

'**Open database connection using provider and path
oConn.Open Provider & Path

End Function


I know for sure that the SQL statements I am using work fine as the page works great outside of FrontPage. The connection to the database is the issue.

I do not want to use the database wizard.  The ASP is working outside FrontPage.  I brought the ASP into Frontpage and am trying to setup the connection manually.  I am not new to FrontPage or Access but I am relatively new to ASP and ADO.

If anyone out there can help me with this I would greatly appreciate it.

Thanks in advance,
Maggs

RE: Frontpage/ASP creating a manual connection to an Access database.

You were almost there.  Just don't use global.asa because the DSN may not be set up correctly.  Try a DSN-less connection

CODE

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
<%
Function OpenDatabase()
Set oConn = Server.CreateObject("ADODB.Connection")

'**Providers
' Don't use Jet - it may work or fail depending on which
' version of office is installed.
'Provider = "Provider=Microsoft.Jet.OLEDB.4.0;"

Provider = "DRIVER={Microsoft Access Driver (*.mdb)};"

'**Paths
'Path = "DBQ=URL=fpdb/vwNEWSclients.mdb"

Path = "DBQ=" & Server.MapPath("fpdb/vwNEWSclients.mdb") & ";"

'Path = "Data Source=fpdb/vwNEWSclients.mdb"'

'**Open database connection using provider and path
oConn.Open Provider & Path

End Function

What you can try on the command line, just to satisfy yourself that it works is to

1) rename the .asp to .vbs
2) remove the <% and %>
3) remove all Server.
4) Just do an open using select * from table.

Just check if that works.  If it doesn't, you may need to prefix the path with ./

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close