软件测试开源工具Rational Robot SQABasic数据库操作相关命令[3]

发表于:2009-11-18来源:作者:点击数: 标签:软件测试数据库rationalRATIONALRational
软件测试 开源 工具 Rational Robot SQA Basic数据库操作相关命令[3] 关键字:SQABasic 数据库 命令 SQLGetSchema Example This example opens the data source named "SblTest," gets the names in the ODBC data sources, and closes the connection. Sub

软件测试开源工具Rational Robot SQABasic数据库操作相关命令[3]

  关键字:SQABasic 数据库 命令

  SQLGetSchema Example

  This example opens the data source named "SblTest," gets the names in the ODBC data sources, and closes the connection.

  Sub main

  '' Declarations

  Dim outputStr As String

  Dim connection As Long

  Dim prompt As Integer

  Dim datasources(1 To 50) As Variant

  Dim retcode As Variant

  Dim action1 as Integer

  Dim qualifier as String

  prompt = 5

  '' Open the datasource "SblTest"

  connection = SQLOpen("DSN=SblTest", outputStr, prompt:=5)

  action1 = 1 '' Get the names of the ODBC datasources

  retcode = SQLGetSchema(connection:=connection,action:=1, qualifier:=qualifier, ref:=datasources())

  '' Close the datasource connection

  retcode = SQLClose(connection)

  End Sub

  SQLOpen 功能函数

  建立一个到在connectStr里指定的ODBC数据源的连接并返回一个连接ID,并将完全的连接字符串赋予outputStr变量。如果连接不可用,返回ODBC错误的负数。

  SQLOpen ( connectStr$ [ , outputStr$] [ , prompt%] )

  语法: 参数 解释

  connectStr$ 指定参数,必须参数。

  outputStr$ 可选

  prompt% 可选。Prompt指定何时驱动对话框出现。可选项:

 

原文转自:http://www.ltesting.net