|
本帖最后由 xchen 于 2014-3-12 10:14 编辑
- Dim Cnn, Rst, strCnn
- strCnn = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=192.168.0.210;DATABASE=TrademarkManager2;USER=trademarkmanager;password=123456"
- Set Cnn = CreateObject("ADODB.connection")
- Cnn.Open strCnn
- Set Rst = CreateObject("ADODB.Recordset")
- Rst.Open "select price_tax from adm_contract where id = 1198",cnn,1,1
- If (not Rst.EOF) Then
- Msgbox Rst.Fields("price_tax")
- End If
- Rst.Close
- Cnn.Close
- Set Rst = Nothing
- Set Cnn = Nothing
复制代码
这样子写为什么不能取出ID字段的值呢?
提示的错误是:
[Microsoft][ODBC 驱动程序管理器] 程序类型越界 |
|