我想用VB连接oracle,执行这一条更新update yong_a set b=1 where a = (控件test1填进去的数字)
只需执行这一条sql语句:update yong_a set b=1 where a = (控件test1填进去的数字),最好能用adodb连接
数据库是:diy 帐号:system 密码:1;小弟不才,看了两天VB连接oracle还是没弄懂,希望高手搭救!
希望能把整一个语句写下来让小弟研究研究
[解决办法]
Public CNADO As New ADODB.ConnectionPublic rs As New ADODB.RecordsetPublic rs1 As New ADODB.RecordsetDim sql As StringDim connect As StringFunction data_connection() As BooleanOn Error GoTo dataconnectionerrSet CNADO = New ADODB.ConnectionCNADO.Provider = "MSDAORA"CNADO.ConnectionTimeout = 10CNADO.CursorLocation = adUseClientCNADO.Open "DATA SOURCE=diy;", "system", "1"'CNADO.Open "DATA SOURCE=数据库;", "账号", "密码"date_connection = TrueExit Functiondataconnectionerr: MsgBox Err.Description Data_Connect = FalseEnd FunctionPrivate Sub Command1_Click()Call Command2_ClickEnd SubPrivate Sub Command2_Click()On Error GoTo error1:Set rs = New Recordsetsql = "" + Text1.Text + "" rs.Open sql, CNADO, adOpenStatic Set DataGrid1.DataSource = rs Exit Suberror1: MsgBox "no table"End SubPrivate Sub Form_Load()data_connectionEnd Sub