# Re: VB and Oracle

Posted by 安宝 on October 08, 1998 at 11:11:49:

In Reply to: VB and Oracle posted by 孤鹰 on October 08, 1998 at 10:46:37:

:来 , 给你 sample :
: 1. 首先 , 在 模组内加入以下
: Public OraSession As Object
: Public OraDatabase As Object
: Public OraDynaset As Object
: Public SQL$
: Public MyDyn As Object

: 2. 在主form内加入以下
: UserName = User ID
: Password = Password
: DatabaseName = HOST IP Address
: Connect = UserName + "/" + Password
: Set OraSession = _
: CreateObject("OracleInProcServer.XOraSession")
: Set OraDatabase = _
: OraSession.DbOpenDatabase(DatabaseName, Connect, 0&)

: 2. 在使用的 Form 中加入 ORADC1,DBGrid1 物件

: 3. 在处理时参照以下
: SQL$ = SQL Language
: Set MyDyn = OraDatabase.DbCreateDynaset(SQL$, 0&)
: Set ORADC1.Recordset = MyDyn

: 4. 每次处理完要更新 DBGrid1 时 , 重覆上述程序3

Follow Ups: