Page 1 of 1 1
Topic Options
#77433 - 2001-04-03 09:02 AM DB
Anonymous
Unregistered


Hi gang,

I have some problems regarding the brand new Createobject function. I do the following:

<code>
$DB = Createobject(ADODB.Connection)
$RC = $DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA SOURCE=c:\db1.mdb")
</code>

But i keep getting an error saying missing parameter 2! But there should not be any more parameters?!?

Otherwise the new Kixtart rocks

------------------
Cheers....

David

Top
#77434 - 2001-04-03 06:31 PM Re: DB
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Hi Hallas,

I tried this:

code:

break on cls


$DB = Createobject(ADODB.Connection)
"db = " $db ?


$RC = $DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA SOURCE=c:\call\support.mdb", "", "", "")
"rc = " $rc ?


and got

db = 0
rc =

Not working, but maybe closer...


cj

P.S. Try [ instead of < for the CODE tag.

------------------
For more scripts goto my website and click the hammer and spanner icon.

chrismat@ozemail.com.au

Top
#77435 - 2001-04-03 07:04 PM Re: DB
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
David:

You're right. To my mind (theorectically) Kix should NOT be complaining about the second parameter. Just how "Object Aware" has KiX2001 become ? Is Kix querying the TypeLib's of Automation servers ? How else would it know that this method takes more than one parameter ? Unless the automation server is reporting this back to Kix.

Anyway... cj's bagged it...

code:

break on cls


$db = Createobject(ADODB.Connection)


$db.open ("PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA SOURCE=m:\msaccess\db1.mdb","","","")


if $db
?"mode=" $db.mode
?"provider=" $db.provider
?"ConnectionString=" $db.connectionstring
$db.close()
endif


?"pause..." gets $k


exit


Shawn.

[This message has been edited by Shawn (edited 04 April 2001).]

Top
#77436 - 2001-04-04 09:15 AM Re: DB
Anonymous
Unregistered


Thanks for the replies...

But actually now I am confused. I have read the ADO API, and it states that the Open method 5 optional parameters, but Kix say they are required ??? But OK kix2001 is still in beta, but anyway. When I try the below code, I dont get any returncodes, does it work, or dont it work???

code:

; Create and open ADO connection
$objConn = Createobject(ADODB.Connection)
$RC = $objConn.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA SOURCE=c:\db1.mdb", "", "", "")

; Create Recordset object
$objRS = Createobject(ADODB.Recordset)
$strSQL = "SELECT * FROM TABLE1"

; Open Recordset (Query the database)
$RC = $objRS.Open ($strSQL, $objConn, "", "", "")

; Move to the first entry
$RC = $objRS.Movefirst

$RC = $objRS.BOF
Messagebox("'$RC'", "Test", 64, 0)
; Clean up
$objRS.Close
$objConn.Close


I have tried to make errors on purpose, but I still dont get any error codes Shawn please use the force

------------------
Cheers....

David

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1447 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

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