ms-access

How do I connect to an MS Access database using Perl?

大兔子大兔子 提交于 2019-12-29 08:01:13
问题 I have a .accdb file on my local machine and I am trying to connect to it and read some data from 3 tables within the DB. How do I establish the connection using Perl? So far I have scraped together this much for MS Access, but I am getting errors saying that I am not using the correct driver. Any ideas? my $msaccess_dbh = DBI->connect( 'dbi:ODBC:driver=microsoft access driver (*.accdb);' . 'dbq=C:\path\to\database\databasefile.accdb' ); Thanks! EDIT: Just to clarify, I have no real

Sql query to create a calculated field

為{幸葍}努か 提交于 2019-12-29 07:57:29
问题 I have a database table like this: I hope I can explain this well, so you can understand. I want to calculate how many hours each employee has worked. For example for "Arjeta Domi" we have Cell(2,3) - Cell(3,3) + Cell(4,3) + Cell(5,3), making the difference of each logOut time with Login time. The final table that I want will have these columns: CardNo , UserName , Date , PauseTime , WorkTime I tried this query: taken from the duplicate SELECT DISTINCT [Card NO], [User Name], ( SELECT MIN

Sql query to create a calculated field

↘锁芯ラ 提交于 2019-12-29 07:57:02
问题 I have a database table like this: I hope I can explain this well, so you can understand. I want to calculate how many hours each employee has worked. For example for "Arjeta Domi" we have Cell(2,3) - Cell(3,3) + Cell(4,3) + Cell(5,3), making the difference of each logOut time with Login time. The final table that I want will have these columns: CardNo , UserName , Date , PauseTime , WorkTime I tried this query: taken from the duplicate SELECT DISTINCT [Card NO], [User Name], ( SELECT MIN

Why is my Access database not up-to-date when I read it from another process?

吃可爱长大的小学妹 提交于 2019-12-29 07:52:09
问题 In my application I do the follwing things: Open a Access database (.mdb) using Jet/ADO and VB6 Clear and re-fill a table with new data Close the database Start another process which does something with the new data. The problem is that sometimes the second process cannot find the new data. Sometimes the table is just empty, sometimes RecordCount > 0, but EOF is true and I cannot do a MoveFirst or MoveNext. In a nutshell: All kinds of weird things. My current workaround is adding a delay

Reset autonumber seed

雨燕双飞 提交于 2019-12-29 07:42:11
问题 I have a VB6/Access application that occasionally encounters a problem with wrong autonumber field seed. Lets say there is a table MYTABLE with an autonumber field ID (that is also the primary key). Lets say at the moment the maximum value of ID is 1000. When the application inserts a new record (ID value is not provided explicitly), for some reason it decides that the next autonumber field value is 950 (and not 1001 as it should be) - so a primary key violation error occurs. I found a KB

Reset autonumber seed

风流意气都作罢 提交于 2019-12-29 07:42:03
问题 I have a VB6/Access application that occasionally encounters a problem with wrong autonumber field seed. Lets say there is a table MYTABLE with an autonumber field ID (that is also the primary key). Lets say at the moment the maximum value of ID is 1000. When the application inserts a new record (ID value is not provided explicitly), for some reason it decides that the next autonumber field value is 950 (and not 1001 as it should be) - so a primary key violation error occurs. I found a KB

Importing a text with separators using VBA

两盒软妹~` 提交于 2019-12-29 07:42:00
问题 I am trying to automate the adding of new text files, which all have the same (known) layout. The columns are separated using tabs (the TAB button). My question is, is it possible to do this in VBA? Like, in the access wizard for importing text files? I am using the DoCmd.TransferText method in VBA 回答1: You'll need to go through the wizard once to make your specification file. TO do this import your text file like normal but before you get too deep into the wizard click on the bottom left,

Look-up vs relationship Microsoft Access

风格不统一 提交于 2019-12-29 05:32:06
问题 I'm developing a Microsoft Access 2013 based information system. One of the client's demands was to simplify the data entry process by using combo box with available values. For example, instead of entering agentID the client asked to let the user choose agent name from the combo box, the same logic with other similar fields. In brief: I need to avoid as much as possible the need to enter the values ID and let to user choose them from the combo box. Microsoft Access has a built-in lookup

SQL code to insert multiple rows in ms-access table

只谈情不闲聊 提交于 2019-12-29 04:54:13
问题 I'm trying to speed up my code and the bottleneck seems to be the individual insert statements to a Jet MDB from outside Access via ODBC. I need to insert 100 rows at a time and have to repeat that many times. It is possible to insert multiple rows in a table with SQL code? Here is some stuff that I tried but neither of them worked. Any suggestions? INSERT INTO tblSimulation (p, cfYear, cfLocation, Delta, Design, SigmaLoc, Sigma, SampleSize, Intercept) VALUES (0, 2, 8.3, 0, 1, 0.5, 0.2, 220,

How can I convert an MDB (Access) file to MySQL (or plain SQL file)?

ε祈祈猫儿з 提交于 2019-12-29 02:18:13
问题 Is it possible to create a Dump of SQL commands from a Microsoft Access database? I hope to convert this MDB file into a MySQL database for importing so I don't have to go through the CSV step. I would expect even an MSSQL dump file to still contain workable SQL commands, but I know nothing of MSSQL, please let me know. 回答1: You want to convert mdb to mysql (direct transfer to mysql or mysql dump)? Try a software called Access to MySQL. Access to MySQL is a small program that will convert