Solved

Accessing Access DB works locally but not on server

Posted on 2009-05-06
9
596 Views
Last Modified: 2012-05-06
Hi guys,

ASP .NET website that I created doesn't work on IIS 7 on SBS 2008. It says provider is not registered. I did install Access engine but I still get that error. It has something to do with this server being 64 bit. I tried setting app pool to run 32-bit apps but the pool stops working when I try accessing the website. How do I make this work? Is it not possible to use Access database for an ASP website on SBS 2008?
0
Comment
Question by:RealSnaD
  • 5
  • 4
9 Comments
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 24321593
for access
http://www.connectionstrings.com/access
Access 2007
http://www.connectionstrings.com/access-2007

Sometimes it is just a slight mis-spelling of a word that can cause this issue.

Good Luck
Carrzkiss
0
 
LVL 7

Author Comment

by:RealSnaD
ID: 24321656
No, my access string is fine. The website works locally just fine. The connection to the db fails.
0
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 24321671
I am not a ASP.NET, I do ASP Classic.
But, what is your connection string?
Can you provide that? Also, have you tried a JET connection
Something like this?

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("YourDB.mdb") & ";"
objConn.Open

All Servers come default with the Jet Engine installed, so i am pretty sure that it will work.
As mentioned, I do not know nothing about .NET, so I am not sure if this is the correct way for doing the connection string of not.

Good Luck
Carrzkiss
0
 
LVL 7

Author Comment

by:RealSnaD
ID: 24322768
Here is the code where it fails (includes my connection string which I got from that website you provided). It actually works fine on our IIS 6 server on Windows Server 2003 Enterprise (it's 32 bit...). From what I understand there is not JET engine for Access that works under 64 bit systems...

There is one I idea I had. We have our router setup so that it redirects port 80 to our main SBS server with IIS 7 (192.168.1.2). The server that my website actually works fine on is 192.168.1.7. I could, of course, set it up with some random port an forward that port to 192.168.1.7. But I don't want users to type in www.mywebsite.com:random_port. Is it possible to set our IIS 7 up so it redirects all requests to IIS 6?

   
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender

        Session("SCart") = "CartSession"

        Dim strConn As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\titanmusic.accdb;Persist Security Info=True"

        Dim objConnection As New System.Data.OleDb.OleDbConnection(strConn)

        Dim strSQL As String = "SELECT COUNT(*) FROM Cart WHERE SessionID='" & Session.SessionID & "'"

        Dim objCommand As New System.Data.OleDb.OleDbCommand(strSQL, objConnection)
 

        Try

            objConnection.Open()
 

            itemsInCart = objCommand.ExecuteScalar
 

            objConnection.Close()

        Catch ex As Exception

            Response.Write("Connection failed to open. Error: " & ex.ToString())

        End Try

    End Sub

Open in new window

0
Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

 
LVL 30

Accepted Solution

by:
Wayne Barron earned 500 total points
ID: 24322927
I run IIS5 here (Winxp) IIS6 on hosting server.
OK.
Yes - You can do a redirect
Open IIS7.
Go to the [Properites] of the site that you want to do the redirect to.
Choose the [Home Directory] Tab.
At the top choose [A redirection to a URL]
Then type in the URL that you want to point it to.
[Apply] then [OK]
Then test it out.

As for IIS7.
I am helping another person with issues on IIS7.
It seems that there is some major issues around this version of IIS.
His issue is the display of XML, and yours is an issue with Connection.

As for Jet not supported under 64bit
http://forums.iis.net/t/1066385.aspx  --- Vista
http://forums.iis.net/t/1148517.aspx  --- 2008

Good Luck
Carrzkiss
0
 
LVL 7

Author Comment

by:RealSnaD
ID: 24328418
I went to http redirect and it's not working. Do you have any idea why my application pool stops working on the first request when I set it to run 32-bit apps in properties?
0
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 24329498
I am sorry, I cannot answer that question.
I have never been faced with such an issue.
Sorry.
0
 
LVL 7

Author Comment

by:RealSnaD
ID: 24341439
No need for an answer, I transferred everything to SQL Server 2008 Enterprise. Using SQLClient for connecting. Works awesome! Thank you for trying to help me!
0
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 24341664
your welcome.
Good luck with your work.

Carrzkiss
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You may have discovered the 'Compatibility View Settings' workaround for making your SBS 2008 Remote Web Workplace 'connect to a computer' section stops 'working around' after a Windows 10 client upgrade.  That can be fixed so it 'works around' agai…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now