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

首頁 > 開發(fā) > 綜合 > 正文

在VB中動(dòng)態(tài)創(chuàng)建數(shù)據(jù)庫

2024-07-21 02:13:34
字體:
供稿:網(wǎng)友

在vb中動(dòng)態(tài)創(chuàng)建數(shù)據(jù)庫
新建工程.添加控件 對(duì)應(yīng)寫上代碼

以下為引用的內(nèi)容:
private sub command2_click()
    dim mydb as dao.database
    'set mydb = dao.opendatabase("d:/mydb3.mdb")
    set mydb = dao.opendatabase(app.path + "/mydb.mdb")
    dim d as string
    d = "delete * from newtable1"
     mydb.execute d
     msgbox "成功刪除全部記錄"
end sub

private sub command3_click()
    dim mydb as dao.database
    'set mydb = dao.opendatabase("d:/mydb3.mdb")
    set mydb = dao.opendatabase(app.path + "/mydb.mdb")
    dim e as string
    e = "drop table newtable1"
    mydb.execute e
end sub

private sub form_load()
    dim mydb as dao.database
    'set mydb = dao.workspaces(0).createdatabase("d:/mydb3.mdb", dblanggeneral)
     set mydb = dao.workspaces(0).createdatabase(app.path + "/mydb.mdb", dblanggeneral)
    dim str_sql as string
    str_sql = "create table newtable1(field1 text(10),field2 short)"
    mydb.execute str_sql
    dim a as string
    a = "insert into newtable1 values ('litao','21')"
    mydb.execute a
  
    str_sql = "create table newtable2(field1 text(10),field2 short)"
    mydb.execute str_sql
    mydb.close
    msgbox "成功創(chuàng)建mydb3.mdb數(shù)據(jù)庫外加一條記錄litao 21"
    end sub 

private sub command1_click()
    dim mydb as dao.database
    'set mydb = dao.opendatabase("d:/mydb3.mdb")
    set mydb = dao.opendatabase(app.path + "/mydb.mdb")
    dim c as string
    c = "insert into newtable1 values ('liqiao','20')"
    mydb.execute c
msgbox "成功插入一條記錄liqiao 20"
end sub

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 临潭县| 柳林县| 宁明县| 耒阳市| 庄河市| 正蓝旗| 德兴市| 新宾| 沿河| 新田县| 青海省| 中山市| 太和县| 新绛县| 延长县| 丰县| 郧西县| 晋州市| 武汉市| 临武县| 两当县| 江源县| 大港区| 布尔津县| 吉安市| 武宁县| 离岛区| 冷水江市| 湖南省| 武强县| 仁怀市| 桐城市| 迭部县| 浮山县| 黄梅县| 基隆市| 嘉黎县| 汉阴县| 辰溪县| 客服| 夹江县|