[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] AFL and ADODB



PureBytes Links

Trading Reference Links

Hi,

is it possible to use Microsoft ActiveX Data Objects 2.6 Library in VBScript in AFL?

I am having some problems to solve this error: (error S0. Arguments are of the wrong type......) at .CursorLocation = adUseClient
and does someone know if I can call an VBScript as a function? 

I am not sure if I am on the right path or if it is better to write this as a .dll and use it as a plugin in Amibroker in afterwards?

Many thanks for your help, dubi

Exp:

blnBuy  = True;
sIBName = "ESU9";

EnableScript("vbscript");	
<%

const cFile_VB = "D:\Amibroker\Trade Reports\MS Access.mdb"
conStrAmibroker_VB = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & cFile_VB 
	
sIBName_VB = AFL("sIBName")
blnBuy_VB = AFL("blnBuy")  
if blnBuy_VB then sAction_VB = "Buy"
	
Set conn_VB = CreateObject("ADODB.Connection") 
conn_VB.Open conStr_VB
Set rs_VB = CreateObject("ADODB.Recordset")
sSql_VB = "SELECT * FROM [tblName]"

With rs_VB
	.Source = sSql_VB
	.ActiveConnection = conn_VB
	.CursorLocation = adUseClient
	.CursorType = adOpenStatic
	.LockType = adLockOptimistic
	.Open
	iRows_VB = .RecordCount
        .AddNew
        '.MoveLast
        ![Contract] = sIBName_VB
        ![Action] = sAction_VB
        .Update
End With
Set rs_VB = Nothing
Set conn_VB = Nothing
AFL ("errorMessage") = err.Description
%>



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/