It's either an MDAC problem or you still have the database open when you are trying to write to it. I would recommend reinstalling MDAC and see if that helps.
Announcement
Collapse
No announcement yet.
Virtual device to Database
Collapse
X
-
I checked to see if the database was still open, no lock file guess its closed.
Tried to reinstall MDAC, Downloaded MDAC 2.8, would not let me reinstall.
Did some web searching can not reinstall because of service pack 2. (it has a higher version of MDAC built in or so they say)
All the XP Pro cd's I have are with sp2
The only way to reinstall MDAC was to reinstall XP Pro, backup HS
burned down the system (reformated) reinstalled XP Pro.
OK, reinstall of XP Pro SP2, no windows updates, no anitivirus,
reloaded HS from backup, Good every things still work's.
tried the script again, still get the same error.
compile error in file: Mate DataBase.txt-2147467259:[Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'. in line 5 More info: [Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'.-Mike-
-Home automation powered by the wind and sun-
Zotac 9300g-Q9400s-4gb ram-Intel 120 SSD-MS XP
HS 2.5.0.20, BLlan,BLweather,MCSXap,Jon00 graphing,Jon00 Whois,Snevl/Ten WeatherAlerts
W2c,Ztroller,z-wave+18,Q100D's,Silex 3000gb
Zoneminder 1.24.2 - Ubuntu 11.04 x64 on top of Xenserve
Zoneminder 1.24.2 - Ubuntu 11.04 x64 Zotac D525 atom
Comment
-
I moved the database to C:\Temp\Mate.mdb, renamed the location in the script that did not work. tried C:\ Mate.mdb , that also did not work.
This kind of looks like the same problem I had trying to get charting to work in Xapchart, under this discussion.
http://board.homeseer.com/showthread.php?t=119200
Also Tried :
DBQ=\\Auto\C:\Mate.mdb
DBQ=\\Auto\C\Mate.mdb
DBQ=\\Auto\C$\Mate.mdb
DBQ=C$\Mate.mdb-Mike-
-Home automation powered by the wind and sun-
Zotac 9300g-Q9400s-4gb ram-Intel 120 SSD-MS XP
HS 2.5.0.20, BLlan,BLweather,MCSXap,Jon00 graphing,Jon00 Whois,Snevl/Ten WeatherAlerts
W2c,Ztroller,z-wave+18,Q100D's,Silex 3000gb
Zoneminder 1.24.2 - Ubuntu 11.04 x64 on top of Xenserve
Zoneminder 1.24.2 - Ubuntu 11.04 x64 Zotac D525 atom
Comment
-
Yes it does look similar. I use the syntax I sent you on dozens of machines without a problem so I'm at a loss as to what the problem may be.
Try this connection string and see if it works for you.
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\myDb.mdb;"
Comment
-
Originally posted by zap View PostDan,
Not sure I understand your question?
I would like to log this data to see trends.
What did you need to do to make a access database file (the actual structure)?
I'm not terribly familiar with mdb files aside from knowing that HS uses one, and people can talk to them in HS.
--DanTasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.
Comment
-
Rupp,
Its' probably just something Iam doing wrong.
Running the new string I get this.
- Error - Running script, script run or compile error in file: Mate DataBase.txt3001:Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. in line 12 More info: Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.-Mike-
-Home automation powered by the wind and sun-
Zotac 9300g-Q9400s-4gb ram-Intel 120 SSD-MS XP
HS 2.5.0.20, BLlan,BLweather,MCSXap,Jon00 graphing,Jon00 Whois,Snevl/Ten WeatherAlerts
W2c,Ztroller,z-wave+18,Q100D's,Silex 3000gb
Zoneminder 1.24.2 - Ubuntu 11.04 x64 on top of Xenserve
Zoneminder 1.24.2 - Ubuntu 11.04 x64 Zotac D525 atom
Comment
-
Ok. I totally reworked the script. The database you sent me was corrupt so I created a new one and imported your tables. Try this setup.
Script:
Code:Sub Main () db_file = "c:/temp/mate.mdb" Set conn = createobject("ADODB.Connection") conn.ConnectionString = _ "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & db_file & ";" & _ "Persist Security Info=False" conn.Open ' Compose the INSERT statement. statement = "INSERT INTO BatteryVoltage(BVvalue) VALUES ('" & hs.deviceValue("P5") & "')" ' Execute the statement. conn.Execute statement, , adCmdText ' Close the connection. conn.Close End Sub
Attached Files
Comment
-
Thank you Rupp,
I have all the device values inputting info into the fields.
To insert Time and or Date into there field, do I need to insert another statement for time and or date and if so how do I go about it, hs.DeviceLastChange?-Mike-
-Home automation powered by the wind and sun-
Zotac 9300g-Q9400s-4gb ram-Intel 120 SSD-MS XP
HS 2.5.0.20, BLlan,BLweather,MCSXap,Jon00 graphing,Jon00 Whois,Snevl/Ten WeatherAlerts
W2c,Ztroller,z-wave+18,Q100D's,Silex 3000gb
Zoneminder 1.24.2 - Ubuntu 11.04 x64 on top of Xenserve
Zoneminder 1.24.2 - Ubuntu 11.04 x64 Zotac D525 atom
Comment
-
Zap, I've been playing with this for my application:
statement = "INSERT INTO BatteryVoltage(BVvalue,NextField,NextField2,etc) VALUES ('" & hs.deviceValue("P5") & "', 'whatever you want','whatever you want','whatever you want')
Or you can skip fields...as specifying them as you see forces the data to coordinate into the fields specified.
--DanTasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.
Comment
-
Dan,
Thanks for the tip, been playing with it off and on all day
and finally starting to get somewere with it.
man, this scripting stuff is hard if you don't know what all the little "', & () mean. I just keep playing with it till the errors whent away.
-Zap-Mike-
-Home automation powered by the wind and sun-
Zotac 9300g-Q9400s-4gb ram-Intel 120 SSD-MS XP
HS 2.5.0.20, BLlan,BLweather,MCSXap,Jon00 graphing,Jon00 Whois,Snevl/Ten WeatherAlerts
W2c,Ztroller,z-wave+18,Q100D's,Silex 3000gb
Zoneminder 1.24.2 - Ubuntu 11.04 x64 on top of Xenserve
Zoneminder 1.24.2 - Ubuntu 11.04 x64 Zotac D525 atom
Comment
Comment