国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

vb與sqlserver數據庫連接的問題

2024-07-21 02:20:33
字體:
來源:轉載
供稿:網友
 

最近編一個物資管理系統,用vb6.0+sqlserver2000,在編寫executesql函數時出錯,

public function executesql(byval sql as string, msgstring as string) as adodb.recordset
  dim cnn as adodb.connection
  dim rst as adodb.recordset
  dim stokens() as string
  on error goto executesql_error
  stokens = split(sql)
  set cnn = new adodb.connection
  cnn.open connectstring
    if instr("insert,delete,update", ucase$(stokens(0))) then
      cnn.execute sql
      msgstring = stokens(0) & "query sucessful"
    else
      set rst = new adodb.recordset
      rst.open trim$(sql), cnn, adopenkeyset, adlockoptimistic
      set executesql = rst
      msgstring = "查詢到" & rst.recordcount & "條記錄"
    end if
 executesql_exit
    set rst = nothing
    set cnn = nothing
    exit function
 executesql_error
    msgstring = "查詢錯誤" & err.description
    resume executesql_exit

  end function
 
public function connectstring() as string
connectstring = "filedsn=material.dsn;uid=sa;pwd=sa"
end function

預編譯執行時出現錯誤,提示子程序或函數未定義,而且光標指向 executesql_exit,我已經把microsoft activex objects 2.6 library 添加了,數據源也設好了

菜鳥學堂:
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 滁州市| 长海县| 京山县| 高碑店市| 睢宁县| 裕民县| 永清县| 合川市| 宝丰县| 丹东市| 新安县| 福州市| 楚雄市| 曲靖市| 高陵县| 同江市| 商城县| 财经| 龙里县| 平武县| 资阳市| 祁门县| 贡觉县| 龙海市| 鸡泽县| 永兴县| 江华| 江川县| 铜川市| 镇安县| 山东| 庆城县| 浪卡子县| 固阳县| 专栏| 安乡县| 翼城县| 溆浦县| 开江县| 张家川| 柳林县|