[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Calling SQR API from Visual Basic



I'm having trouble calling the SQR API  (SQR 3.0.12.X or 4.0/NT/Oracle)
from Visual Basic 4.0 32-bit running on NT. I receive a run-time error
'49'. Bad DLL calling convention. I've declared the Function as follows:

Public Declare Function sqr30 Lib "c:\sqrw\ora\workbnch\binw\sqrw.dll"
Alias "sqr" (ByVal lpCommandLine As String) As Integer

In my module, I call the function as follows:

Dim txtTest as String
Dim X as Integer

'source directory\sqr filename user/pass@db -IInclude Directory -Mlimits
file -RS
txtTest = txtSource & "\" & txtIndFileName & " " & txtOracleUser & "/" &
txtOraclePassword & "@" & txtOracleDatabase & " -I" & txtInclude & "\ -M" &
 txtInclude.Text & "\dfltover.sqf -RS" & vbNullString

 X = sqr30(txtTest)

SQR seems to execute but I get the error message.

If anybody has gotten this to work I would be grateful to see how you
declared and called the function. This odessy began when I wrote a small VB
 app to compile our *.SQR files into *.SQT files.
(We support both Sybase and Oracle and have about 200+ SQR reports which
get recompiled fairly often) My program identifies all the SQR files in a
directory and then compiles them one by one using VB's shell function. This
 worked fine under Windows 95 where no more than 5 SQR sessions would be
running because they finish quickly enough.

Under NT they start running so quickly that 25+ will start compiling before
 any have finished and the system runs out of resources. Hence, I wanted to
 start using the API because I can call SQR synchronously.

Any help would be greatly appreciated. The program was a big time saver for
 me and I'd be happy to distribute it to anyone who would find it useful.

Thanks,

David Colangelo
American Management Systems
david_colangelo@mail.amsinc.com