Sqlopen in Script......

I need to run a query from script. If the result of the query is true then i need to run some other report. I tried to connect with the database but,
I was not able to connect with database. Say for example I am using a database connection called SblTest. Here, I have sent my script. Please give me any suggestions.

Sub main
’ Declarations

Dim outputStr As String
Dim connection As Long
Dim prompt As Integer
Dim retcode As Variant
Dim result as string
prompt = 5
’ Open the datasource “SblTest”
connection = SQLOpen(“DSN=New test”, outputStr, prompt:=5)

retcode = SQLGetSchema(connection:=connection,action:=1, qualifier:=qualifier, ref:=datasources()) ’ ’ Execute the query
query = “select customer_name.customer into :result from customer”
retcode = SQLExecQuery(connection,query) If result = “AF” Then
Application.Documents.Open(“c:\program
files\businessobjects\BalanceInDFAS_AF.rep”)
end if.

End Sub.

______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com


Listserv Archives (BOB member since 2002-06-25)