Jump to content

Recommended Posts

Posted

Hi,

I've been searching, but haven't been able to find much in the way of help on interfacing with MS Access. I've gotten the UDF to work for the most part and have learned a bit about COM interface from what I've found, however I'm a bit lost. I'm having trouble getting Autoit to post the data in the database.

First thing I learned is that you have to find the actual database, a frontend won't do it...I learned that the hard way ;). But now I can post data in databases that take text values for their first field, however I can't get it to post into a database with an autonumber in the first field.

Any help would be wonderful.

Thanks :)

Posted

Which UDF are you using?

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted

If you are adding a record via the AddRecord func then Either pass it an array with the first element empty or pass it a pipe separated string and start the string with a pipe

$sRec = "|field 1 data|field 2 data|Field 3 data"

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted

If you are adding a record via the AddRecord func then Either pass it an array with the first element empty or pass it a pipe separated string and start the string with a pipe

$sRec = "|field 1 data|field 2 data|Field 3 data"

wow so simple. You know it was really my mistake, I had the first value blank so it would write in properly in the first place...didn't think about having a second one. :) Thanks
Posted

wow so simple. You know it was really my mistake, I had the first value blank so it would write in properly in the first place...didn't think about having a second one. :) Thanks

Well there are other ways but that is by far the simplest. The other methods involve either getting the record count or reading the value from the last record.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted

Another question...

I couldn't find a search function in the UDF although in the _accessDeleteRecord() there's a search function kinda. It's a query right? (I'm just learning a bit about databases :))

Anyways is it possible to use that to check Access to see if a value is already in the database before writing my data into it? or is there an even simpler way?

Posted

Another question...

I couldn't find a search function in the UDF although in the _accessDeleteRecord() there's a search function kinda. It's a query right? (I'm just learning a bit about databases :))

Anyways is it possible to use that to check Access to see if a value is already in the database before writing my data into it? or is there an even simpler way?

It's been a long time since I looked at that UDF since I'm trying to avoid using Access at all but take a look at

_accessQueryLike() and _accessQueryStr()

If your copy of the file has the line

Return 'oops'

in _accessQueryStr() then change that to

SetError(3)

Return ""

I think I may have accidentally uploaded a copy that I was playing with.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...