|
这是一段VB连接INFORMIX的代码.现在vbscript也类似.稍做修改.这类示例网上还是有的,你可以自己找一下
Private Sub Form_Load()
Dim connstr As String
Dim ans As Integer, errstr As String, sql As String
Set cn = New ADODB.Connection
connstr = "UID=cww;PWD=jjh5612;Database=cwwpf@eis;" _
+ "Driver={OpenLink Generic 32 Bit Driver};" _
+ "Host=192.168.0.61;" _
+ ";FetchBufferSize=30" _
+ ";NoLoginBox=Yes" _
+ ";Options=" _
+ Protocol=TCP/IP" _
+ ";ReadOnly=No" _
+ ";ServerOptions=" _
+ ";ServerType=Informix 7.2"
cn.ConnectionString = connstr
cn.Open
sql = "Select * from testab2 order by case_no"
Set rs = New ADODB.Recordset
Set rs.ActiveConnection = cn
rs.CursorLocation = adUseClient
rs.Source = sql
rs.CacheSize = 30
rs.Open , cn, adOpenKeyset, adLockOptimistic, adCmdText
End Sub |
|