Jump to content

Use Access MDF file without access installed?


 Share

Recommended Posts

Hi Randall,

i've played a little bit around the array - but i get errors if i use :

$s_Row = _ArrayCreate("col2","262","26/12/2006")

If i create a array with 4 args it works fine.

$s_Row = _ArrayCreate("x","col2","262","26/12/2006")

What's the first statement for?

Greets

Dizzy

Link to comment
Share on other sites

Hi,

It is always hard to predict in AutoIt how people will make their arrays; it is ambiguous.

Traditionallly, and I have stuck with it here at present, AutoIt uses the first element as the array count (ubound($ar_Array)-1).

eg in HelpFile,

1. StringSplit creates $array[0] as counter element

"Returns an array, the first element ($array[0]) contains the number of strings returned, the remaining elements ($array[1], $array[2], etc.) contain the delimited strings."

2. _FileListToArray

"$array[0] = Number of Files\Folders returned"

3. _DateTimeSplit; $asDatePart "array that contains the Date. $asDatePart[0] number of values returned"

4. _DateTimeSplit;$asTimePart, array that contains the Time. $asTimePart[0] number of values returned"

5. _GUICtrlTabGetItemRECT; Array containing the RECT, first element ($array[0]) contains the number of elements"

6. etc forever..........

"_ArrayCreate" does NOT!

You can't win....

Best, randall

Link to comment
Share on other sites

  • 2 weeks later...

how do you add data to a specific record?

lets say i have and address book

record 3 has name, addres, but no phone number,

how do it tell it to go to that specific record and update that field.

from the examples, it seems as it can only add data after number 5 (whatever is the last line in the database)

Link to comment
Share on other sites

@blitzkrg

You will need to use an UPDATE query.

Start reading this SQL Tutorial

Hope this helps.

regards

ptrex

Yeah i just figured out i had to use the _ExecuteMDB function with an UPDATE query

I was trying to use the _addrecord fucntion

i came back to nuke my post since i figured it out but you got here first..

thanks for the tip though :)

Link to comment
Share on other sites

  • 1 month later...

I'm using the AccessCom script and it is amazing. I really appreciate all the work on this.

I've got my script working where I can write to the database just fine. My problem comes in when I want to read from the database. Is there a way to save each value of each field to a different variable?

I've used the code

$query = "SELECT * FROM " & $s_Tablename & " WHERE " & $Fieldname5 & " = " & False
$strData = _ReadOneField ($query, $s_dbname, $Fieldname1, $o_Con)

This returns the data I want but everything is in one string. I'd like to manipulate each record and then do an UPDATE query. The only way I know to do this is to save each field in each record to their own variables. Any ideas?

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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