Database on Windows x64

Forum regarding Windows Software and Home Automation Domotica.
Post Reply
Darwusch
Member
Member
Posts: 164
Joined: Sun Dec 21, 2008 10:25 pm
Location: Netherlands

Database on Windows x64

Post by Darwusch »

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?
User avatar
Rene
Global Moderator
Global Moderator
Posts: 1689
Joined: Wed Oct 08, 2008 3:54 pm
Location: Netherlands

Re: Database on Windows x64

Post by Rene »

Maybe this will help you making progress
Rene.
Darwusch
Member
Member
Posts: 164
Joined: Sun Dec 21, 2008 10:25 pm
Location: Netherlands

Re: Database on Windows x64

Post by Darwusch »

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: 164
Joined: Sun Dec 21, 2008 10:25 pm
Location: Netherlands

Re: Database on Windows x64

Post by Darwusch »

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" onclick="window.open(this.href);return false;

Now I can access the Access database with asp.
Darwusch
Member
Member
Posts: 164
Joined: Sun Dec 21, 2008 10:25 pm
Location: Netherlands

Re: Database on Windows x64

Post by Darwusch »

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?
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Re: Database on Windows x64

Post by Digit »

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.
LostDreamer
Member
Member
Posts: 73
Joined: Fri Apr 10, 2009 1:43 pm
Location: Netherlands
Contact:

Re: Database on Windows x64

Post by LostDreamer »

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
[url=https://www.viagrasansordonnancefr.com/commander-sildenafil-100-q-sirve/]commander sildenafil 100 q sirve www.viagrasansordonnancefr.com[/url]
Darwusch
Member
Member
Posts: 164
Joined: Sun Dec 21, 2008 10:25 pm
Location: Netherlands

Re: Database on Windows x64

Post by Darwusch »

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: 164
Joined: Sun Dec 21, 2008 10:25 pm
Location: Netherlands

Re: Database on Windows x64

Post by Darwusch »

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: 164
Joined: Sun Dec 21, 2008 10:25 pm
Location: Netherlands

Re: Database on Windows x64

Post by Darwusch »

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.
LostDreamer
Member
Member
Posts: 73
Joined: Fri Apr 10, 2009 1:43 pm
Location: Netherlands
Contact:

Re: Database on Windows x64

Post by LostDreamer »

That, ofcourse, is allways better then Access :)
Nice to hear you solved it.
[url=https://www.viagrasansordonnancefr.com/commander-sildenafil-100-q-sirve/]commander sildenafil 100 q sirve www.viagrasansordonnancefr.com[/url]
Post Reply

Return to “Windows Forum”