Page 1 of 1 1
Topic Options
#117036 - 2004-03-30 07:35 AM using kixtart to write to ms access db
prezbedard Offline
Fresh Scripter

Registered: 2003-06-18
Posts: 10
Loc: Boston Area
I have been reading past posts about kixtart being able to write to a ms access database. I was intrigued because this feature could be very useful to me. I just ran this sample test script but it says there is an expected expression missing on line 3. I copied this sample from here and plugged in my values.


Code:
$dsn='DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\\greg2k\netlogon\test.mdb'
$sql="INSERT INTO Table1 VALUES('eee','fff')"
$recordset = DBCommand($dsn,$sql)
? 'Error = '+@ERROR+' - '+@SERROR
$sql="SELECT Field1, Field2 FROM Table1"
$recordset = DBCommand($dsn,$sql)
? 'Error = '+@ERROR+' - '+@SERROR
for $row=0 to ubound($recordset,1)
for $column=0 to ubound($recordset,2)
? 'Field(row='+$row+', column='+$column+') ='+$recordset[$row,$column]
next
next



What am I doing wrong?

thanks.

Top
#117037 - 2004-03-30 07:59 AM Re: using kixtart to write to ms access db
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Do you have the DBCommand UDF in your script, or do you call it before this part of the script runs?


Please copy the UDF into the code or into another file and then call the UDF before the script that wants it is run.


Download from here or one of the UDF Mirrors

http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=83050&page=11&view=collapsed&sb=3&o=all&fpart=1

Top
#117038 - 2004-03-30 02:48 PM Re: using kixtart to write to ms access db
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You should also read the FAQ Forum under How to use UDFs
_________________________
There are two types of vessels, submarines and targets.

Top
#117039 - 2004-03-31 12:38 AM Re: using kixtart to write to ms access db
prezbedard Offline
Fresh Scripter

Registered: 2003-06-18
Posts: 10
Loc: Boston Area
I'm not familar with UDF's. I will read the info and hopefully have a better understanding.

Thanks.

Top
#117040 - 2004-03-31 08:47 AM Re: using kixtart to write to ms access db
prezbedard Offline
Fresh Scripter

Registered: 2003-06-18
Posts: 10
Loc: Boston Area
ok I went ahead and read the information and added the udf to my script. Upoun execution I received 6 pop up dialog boxes with the statement.

Code:
 The procedure entry point GetIUMS could not be located in the dynamic link library MSDART.DLL 



I then googled this and found this but mostly pertaining to instances of reinstalling/repairing the OS (XP)

Any ideas on how this relates to the script?

After the script halts the following line is printed to the screen twice.

Code:
147352567/80020009] - COM exception error "Open" (ADOBD.Connection - (null)) [-2  



I take it has something to do with the creation of the database connection via kix.

Thanks

Top
#117041 - 2004-03-31 04:50 PM Re: using kixtart to write to ms access db
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Do you have the appropriate database drivers installed? You will need a (preferably latest) version of MDAC.
_________________________
There are two types of vessels, submarines and targets.

Top
#117042 - 2004-03-31 07:19 PM Re: using kixtart to write to ms access db
prezbedard Offline
Fresh Scripter

Registered: 2003-06-18
Posts: 10
Loc: Boston Area
ok I download the latest version of MDAC(2.8) and test script executed successfully. Thanks.

Well this is just the alpha testing so if I have any other questions I'll be back.

The purpose of this is to enhance a login/logoff kix script I have in place right now which just writes to a raw log file but if I can implement this it will make my job easier.

Thanks again

Top
#117043 - 2004-04-01 07:05 PM Re: using kixtart to write to ms access db
prezbedard Offline
Fresh Scripter

Registered: 2003-06-18
Posts: 10
Loc: Boston Area
ok this might be more of an sql question but I have tried several different methods and each time I get errors returned while running the script. How do I plug in an auto number type into the kixtart script? The first field I would like to be an autonumber while the others will be collected using variables @USERID,@DATE ,@TIME there isn't a variable avaible for an autonumber is there? That would make it too easy now.

Thanks

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1045 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.057 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org