Database on Windows x64

Forum regarding Windows Software and Home Automation Domotica.

Database on Windows x64

Postby Darwusch » Wed Dec 23, 2009 11:01 am

For my home server I use Windows 7 x64.
On this server several services are running, e.g. a webserver with IIS 7.5, Homeseer and the Plugwise service.
Now I would like to make a website that uses data from the database that UltraLog (HS plugin) makes from several events.
But here I discovered that the ODBC driver on my system is 32 bit and can not be used with the 64 bit webserver.
A 64 bit ODBC driver is beeing developed (in MS Office 2010) but it's not available as a seperate driver yet, without installing Office 2010.
I have made a seperate application pool in IIS which has "enable 32 bit applications" enabled. But this doesn't seem to help. I can not make contact to an MS Access database through either php or asp.

How do people with a 64 bit windows server solve this? Do you run IIS as a 32 bit application for example?
Darwusch
Member
Member
 
Posts: 163
Joined: December 2008
Location: Netherlands

Re: Database on Windows x64

Postby Rene » Wed Dec 23, 2009 11:10 am

Maybe this will help you making progress
Rene.
User avatar
Rene
Global Moderator
Global Moderator
 
Posts: 1689
Joined: October 2008
Location: Netherlands

Re: Database on Windows x64

Postby Darwusch » Wed Dec 23, 2009 11:44 am

Thank you for the tip Rene. However, this site was the reason why I tried the seperate application pool which I described.
But still I can't contact the Access database.

The error with a php script is with both the default application pool and the 32 bit application pool :
Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application, SQL state IM014 in SQLConnect in C:\inetpub\wwwroot\home\log.php

With asp I get a HTTP 500 Internal Server Error, with both application pools.

I can't find what I'm doing wrong here. It's weird I don't see a different result.
Darwusch
Member
Member
 
Posts: 163
Joined: December 2008
Location: Netherlands

Re: Database on Windows x64

Postby Darwusch » Wed Dec 23, 2009 1:59 pm

Finally I solved it. There were no read permissions in the registry to the ODBC driver locations.
I found the solution here:
http://support.microsoft.com/kb/306345

Now I can access the Access database with asp.
Darwusch
Member
Member
 
Posts: 163
Joined: December 2008
Location: Netherlands

Re: Database on Windows x64

Postby Darwusch » Wed Dec 23, 2009 3:12 pm

Ok now I have another challenge.
I can get access to a database, but not to a database that is in use by the program that writes to it.
Then this message occurs:

Code: Select all
Microsoft JET Database Engine error '80004005'
Could not use ''; file already in use.


I'm sure it must be possible to only read from a database.
I searched the internet but I can't find a working solution.

The following code is used to open the database:
Code: Select all
Dim adoCon
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & DBPath = server.mappath("database.mdb")


And the error is on the last line given here.
Could somebody help me out here?
Darwusch
Member
Member
 
Posts: 163
Joined: December 2008
Location: Netherlands

Re: Database on Windows x64

Postby Digit » Wed Dec 23, 2009 3:29 pm

This looks incorrect:
& DBPath = server.mappath("database.mdb")
propably should be
& DBPath & server.mappath("database.mdb") ?
and put the result on the screen to check if the value is ok.
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Re: Database on Windows x64

Postby LostDreamer » Wed Dec 23, 2009 3:38 pm

I've had similar problems when trying to set up a ODBC connection from PHP to the Plugwise database.
There is a read-only setting when you go to your system-DSN connections where you set up the ODBC connection to the access db
click on Options and select the read-only.

It might be that this does the trick (it did not for me, since plugwise had the file set as exclusive)

Finaly I had to go for a work-around:
Since the plugwise DB was only updated every hour, I could have the file copied to a different location and set up my ODBC connection to the copy.
Then have a task copy the DB every hour.
PHP / ASP / VBscript was unable to copy the file because of the File in use error, But Windows Explorer (and batch files) could.

Hope it can help you.

LostDreamer
LostDreamer
Member
Member
 
Posts: 73
Joined: April 2009
Location: Netherlands

Re: Database on Windows x64

Postby Darwusch » Wed Dec 23, 2009 3:54 pm

Because I had to point to the physical path, I changed my code to:
Code: Select all
adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & "C:/Program Files (x86)/HomeSeer HSPRO/Data/UltraLog/database.mdb"

And that gives the same error.
Darwusch
Member
Member
 
Posts: 163
Joined: December 2008
Location: Netherlands

Re: Database on Windows x64

Postby Darwusch » Wed Dec 23, 2009 6:13 pm

LostDreamer wrote:Finaly I had to go for a work-around:
Since the plugwise DB was only updated every hour, I could have the file copied to a different location and set up my ODBC connection to the copy.
Then have a task copy the DB every hour.
PHP / ASP / VBscript was unable to copy the file because of the File in use error, But Windows Explorer (and batch files) could.

LostDreamer


The copying works, with a seperate script in homeseer.
Thank you!
Darwusch
Member
Member
 
Posts: 163
Joined: December 2008
Location: Netherlands

Re: Database on Windows x64

Postby Darwusch » Thu Dec 24, 2009 1:22 pm

Because MySQL doesn't have the problem with database files which are in use (and inaccessible), I switched to MySQL.
This works a lot better. Also it has 64 bit drivers.
Darwusch
Member
Member
 
Posts: 163
Joined: December 2008
Location: Netherlands

Re: Database on Windows x64

Postby LostDreamer » Thu Dec 24, 2009 1:37 pm

That, ofcourse, is allways better then Access :)
Nice to hear you solved it.
LostDreamer
Member
Member
 
Posts: 73
Joined: April 2009
Location: Netherlands


Return to Windows Forum

Who is online

Users browsing this forum: No registered users and 1 guest