TC官方合作论坛

 找回密码
 立即注册
查看: 2213|回复: 6

[其他] 大龙最新数据库插件,通用所用类型,格式统一,不需要.....

[复制链接]
发表于 2017-10-15 01:25:04 | 显示全部楼层 |阅读模式

马上加入TC

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
数据库全平台统一格式,方便统一书写,任何数据库都可以使用了,全部都整合到一起了,高效快速。以下以按键调用例子为例,写法都差不多
  • 数据库连接部分讲解
Plugin.DL.ConnectMyDB("MySQL", "用户名", "密码", "服务器IP", "数据库名字", 端口)
例如:
Plugin.DL.ConnectMyDB("MySQL", "root", "1234560", "localhost", "studb", 3306)
Plugin.DL.ConnectMyDB("SQLite", "", "", "", "D:\test.db", 0)
Plugin.DL.ConnectMyDB("SQL Server", "admin", "123456", "202.102.11.252", "datebase", 1433)
Plugin.DL.ConnectMyDB("SQLite", "", "", "", "D:\test.db", 0)
Plugin.DL.ConnectMyDB("Access", "", "", "localhost", "D:\my.accdb", 0)
Plugin.DL.ConnectMyDB("Oracle", "账号", "密码", "localhost", "", 0)
看到没所有数据库都支持,很方便的,书写格式都一致!!!
-------------------------------------------------------------------------------------------------------------
实战代码
//按键插件调用方式 MySQL
ret = Plugin.DL.ConnectMyDB("MySQL", "root", "1234560", "localhost", "studb", 3306)
If ret =1 Then
       s = Plugin.DL.GetTable("SELECT * FROM 本地学员 limit 0,10 ")
       MessageBox s
       //s = Plugin.DL.InsertSQL("insert into 本地学员(stuname) values(1)")
       //MessageBox s        
       //s = Plugin.DL.UpdateSQL("update 本地学员 set stuname ='givl' where id = 1")
       //MessageBox s
      // s = Plugin.DL.DeleteSQL("delete from 本地学员 where id = 1")
       //MessageBox s
       //s = Plugin.DL.ExecSQL("insert into 本地学员 VALUES('1','1','2','3','1','2')")
       //MessageBox s
       ret = Plugin.DL.CloseMyDB  
    Else
  MessageBox ret            
End If


//按键插件调用方式 SQL Server
ret = Plugin.DL.ConnectMyDB("SQL Server", "admin", "123456", "202.102.11.252", "datebase", 1433)

If ret =1 Then
       s = Plugin.DL.GetTable("SELECT top 10 * FROM whsw  ")
       MessageBox s
       //s = Plugin.DL.InsertSQL("insert into 本地学员(stuname) values(1)")
       //MessageBox s        
       //s = Plugin.DL.UpdateSQL("update 本地学员 set stuname ='givl' where id = 1")
       //MessageBox s
      // s = Plugin.DL.DeleteSQL("delete from 本地学员 where id = 1")
       //MessageBox s
       //s = Plugin.DL.ExecSQL("insert into 本地学员 VALUES('1','1','2','3','1','2')")
       //MessageBox s
       ret = Plugin.DL.CloseMyDB  
    Else
  MessageBox ret            
End If

//按键插件调用方式 SQLite
ret = Plugin.DL.ConnectMyDB("SQLite", "", "", "", "D:\test.db", 0)
If ret =1 Then
       s = Plugin.DL.GetTable("SELECT * FROM people limit 0,10  ")
       MessageBox s
       //s = Plugin.DL.InsertSQL("insert into people(myname) values(1)")
       //MessageBox s        
       //s = Plugin.DL.UpdateSQL("update people set myname ='givl2' where id = 3")
       //MessageBox s
       //s = Plugin.DL.DeleteSQL("delete from people where id = 3")
       //MessageBox s
       //s = Plugin.DL.ExecSQL("insert into people VALUES('1','1','2','3','1','2')")
       //MessageBox s
       ret = Plugin.DL.CloseMyDB  
    Else
  MessageBox ret            
End If

//按键插件调用方式 Access
ret = Plugin.DL.ConnectMyDB("Access", "", "", "localhost", "D:\my.accdb", 0)
If ret =1 Then
       s = Plugin.DL.GetTable("SELECT top 10 * FROM people ")
       MessageBox s
       //s = Plugin.DL.InsertSQL("insert into 本地学员(stuname) values(1)")
       //MessageBox s        
       //s = Plugin.DL.UpdateSQL("update 本地学员 set stuname ='givl' where id = 1")
       //MessageBox s
      // s = Plugin.DL.DeleteSQL("delete from 本地学员 where id = 1")
       //MessageBox s
       //s = Plugin.DL.ExecSQL("insert into 本地学员 VALUES('1','1','2','3','1','2')")
       //MessageBox s
       ret = Plugin.DL.CloseMyDB  
    Else
  MessageBox ret            
End If

//按键插件调用方式 Oracle
ret = Plugin.DL.ConnectMyDB("Oracle", "账号", "密码", "localhost", "", 0)
If ret =1 Then
       s = Plugin.DL.GetTable("SELECT top 10 * FROM people ")
       MessageBox s
       //s = Plugin.DL.InsertSQL("insert into 本地学员(stuname) values(1)")
       //MessageBox s        
       //s = Plugin.DL.UpdateSQL("update 本地学员 set stuname ='givl' where id = 1")
       //MessageBox s
      // s = Plugin.DL.DeleteSQL("delete from 本地学员 where id = 1")
       //MessageBox s
       //s = Plugin.DL.ExecSQL("insert into 本地学员 VALUES('1','1','2','3','1','2')")
       //MessageBox s
       ret = Plugin.DL.CloseMyDB  
    Else
  MessageBox ret            
End If



网盘地址
h ttps://pan.baidu.com/s/1cpUMke
QQ技术群:621816328



回复

使用道具 举报

 楼主| 发表于 2017-10-15 01:27:45 | 显示全部楼层
插件采用VC 和 Delphi编写,部分采用汇编,算法效率极高!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-10-15 17:26:43 | 显示全部楼层
TC调用方式
function button0_click()
        var path=sysgetcurrentpath()       
                //messagebox(FilePath)
        var DL=com("DL.DLdb")
   
    //SQLite数据库
    var FilePath = path&"测试用的部分数据库文件\\test.db"
    var ret=DL.ConnectMyDB("SQLite", "", "", "",FilePath, 0)
        if(ret=1)
        var s1=DL.GetTable("SELECT * FROM people limit 0,10  ")
                messagebox(s1)
        //---------------------------------------------------------------------------------
                   var s2=DL.InsertSQL("insert into people(myname) values(1)")
                   messagebox(s2)
        //---------------------------------------------------------------------------------
                   var s3=DL.UpdateSQL("update people set myname ='givl2' where id = 3")
                   messagebox(s3)
        //---------------------------------------------------------------------------------
                   var s4=DL.DeleteSQL("delete from people where id = 3")
                   messagebox(s4)
        //---------------------------------------------------------------------------------
                   var s5=DL.ExecSQL("insert into people VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        //---------------------------------------------------------------------------------
        end
        ret = DL.CloseMyDB  
        messagebox(ret)  
   
    //Access数据库
    var FilePath = path&"测试用的部分数据库文件\\my.accdb"
    var ret=DL.ConnectMyDB("Access", "", "", "localhost",FilePath, 0)
        if(ret=1)
        var s1=DL.GetTable("SELECT top 10 * FROM people ")
                messagebox(s1)
        //---------------------------------------------------------------------------------
                   var s2=DL.InsertSQL("insert into 本地学员(myname) values(1)")
                   messagebox(s2)
        //---------------------------------------------------------------------------------
                   var s3=DL.UpdateSQL("update 本地学员 set myname ='givl2' where id = 3")
                   messagebox(s3)
        //---------------------------------------------------------------------------------
                   var s4=DL.DeleteSQL("delete from 本地学员 where id = 1")
                   messagebox(s4)
        //---------------------------------------------------------------------------------
                   var s5=DL.ExecSQL("insert into 本地学员 VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        //---------------------------------------------------------------------------------
        end
        ret = DL.CloseMyDB  
        messagebox(ret)  
   
    //MySQL数据库
    var ret=DL.ConnectMyDB("MySQL", "root", "1234560", "localhost", "studb", 3306)
        if(ret=1)
        var s1=DL.GetTable("SELECT * FROM people limit 0,10  ")
                messagebox(s1)
        //---------------------------------------------------------------------------------
                   var s2=DL.InsertSQL("insert into people(myname) values(1)")
                   messagebox(s2)
        //---------------------------------------------------------------------------------
                   var s3=DL.UpdateSQL("update people set myname ='givl2' where id = 3")
                   messagebox(s3)
        //---------------------------------------------------------------------------------
                   var s4=DL.DeleteSQL("delete from people where id = 3")
                   messagebox(s4)
        //---------------------------------------------------------------------------------
                   var s5=DL.ExecSQL("insert into people VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        //---------------------------------------------------------------------------------
        end
        ret = DL.CloseMyDB  
        messagebox(ret)  
   
     //SQL Server数据库
    var ret=DL.ConnectMyDB("SQL Server", "admin", "123456", "202.102.11.252", "datebase", 1433)
        if(ret=1)
        var s1=DL.GetTable("SELECT top 10 * FROM whsw  ")
                messagebox(s1)
        //---------------------------------------------------------------------------------
                   var s2=DL.InsertSQL("insert into whsw(myname) values(1)")
                   messagebox(s2)
        //---------------------------------------------------------------------------------
                   var s3=DL.UpdateSQL("update whsw set myname ='givl2' where id = 3")
                   messagebox(s3)
        //---------------------------------------------------------------------------------
                   var s4=DL.DeleteSQL("delete from whsw where id = 3")
                   messagebox(s4)
        //---------------------------------------------------------------------------------
                   var s5=DL.ExecSQL("insert into whsw VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        //---------------------------------------------------------------------------------
        end
        ret = DL.CloseMyDB  
        messagebox(ret)  
   
     //Oracle数据库
    var ret=DL.ConnectMyDB("Oracle", "账号", "密码", "localhost", "", 0)
        if(ret=1)
        var s1=DL.GetTable("SELECT top 10 * FROM people  ")
                messagebox(s1)
        //---------------------------------------------------------------------------------
                   var s2=DL.InsertSQL("insert into people(myname) values(1)")
                   messagebox(s2)
        //---------------------------------------------------------------------------------
                   var s3=DL.UpdateSQL("update people set myname ='givl2' where id = 3")
                   messagebox(s3)
        //---------------------------------------------------------------------------------
                   var s4=DL.DeleteSQL("delete from people where id = 3")
                   messagebox(s4)
        //---------------------------------------------------------------------------------
                   var s5=DL.ExecSQL("insert into people VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        //---------------------------------------------------------------------------------
        end
        ret = DL.CloseMyDB  
        messagebox(ret)     
end
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-10-15 17:31:17 | 显示全部楼层
function button0_click()
        var path=sysgetcurrentpath()       
        var DL=com("DL.DLdb")

    //SQLite数据库
    var FilePath = path&"测试用的部分数据库文件\\test.db"
    var ret=DL.ConnectMyDB("SQLite", "", "", "",FilePath, 0)
        if(ret=1)
        var s1=DL.GetTable("SELECT * FROM people limit 0,10  ")
                messagebox(s1)
        //---------------------------------------------------------------------------------
                   var s2=DL.InsertSQL("insert into people(myname) values(1)")
                   messagebox(s2)
        //---------------------------------------------------------------------------------
                   var s3=DL.UpdateSQL("update people set myname ='givl2' where id = 3")
                   messagebox(s3)
        //---------------------------------------------------------------------------------
                   var s4=DL.DeleteSQL("delete from people where id = 3")
                   messagebox(s4)
        //---------------------------------------------------------------------------------
                   var s5=DL.ExecSQL("insert into people VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        //---------------------------------------------------------------------------------
        end
        ret = DL.CloseMyDB  
        messagebox(ret)  

    //Access数据库
    var FilePath = path&"测试用的部分数据库文件\\my.accdb"
    var ret=DL.ConnectMyDB("Access", "", "", "localhost",FilePath, 0)
        if(ret=1)
        var s1=DL.GetTable("SELECT top 10 * FROM people ")
                messagebox(s1)
        //---------------------------------------------------------------------------------
                   var s2=DL.InsertSQL("insert into 本地学员(myname) values(1)")
                   messagebox(s2)
        //---------------------------------------------------------------------------------
                   var s3=DL.UpdateSQL("update 本地学员 set myname ='givl2' where id = 3")
                   messagebox(s3)
        //---------------------------------------------------------------------------------
                   var s4=DL.DeleteSQL("delete from 本地学员 where id = 1")
                   messagebox(s4)
        //---------------------------------------------------------------------------------
                   var s5=DL.ExecSQL("insert into 本地学员 VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        //---------------------------------------------------------------------------------
        end
        ret = DL.CloseMyDB  
        messagebox(ret)  

    //MySQL数据库
    var ret=DL.ConnectMyDB("MySQL", "root", "1234560", "localhost", "studb", 3306)
        if(ret=1)
        var s1=DL.GetTable("SELECT * FROM people limit 0,10  ")
                messagebox(s1)
        //---------------------------------------------------------------------------------
                   var s2=DL.InsertSQL("insert into people(myname) values(1)")
                   messagebox(s2)
        //---------------------------------------------------------------------------------
                   var s3=DL.UpdateSQL("update people set myname ='givl2' where id = 3")
                   messagebox(s3)
        //---------------------------------------------------------------------------------
                   var s4=DL.DeleteSQL("delete from people where id = 3")
                   messagebox(s4)
        //---------------------------------------------------------------------------------
                   var s5=DL.ExecSQL("insert into people VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        //---------------------------------------------------------------------------------
        end
        ret = DL.CloseMyDB  
        messagebox(ret)  

     //SQL Server数据库
    var ret=DL.ConnectMyDB("SQL Server", "admin", "123456", "202.102.11.252", "datebase", 1433)
        if(ret=1)
        var s1=DL.GetTable("SELECT top 10 * FROM whsw  ")
                messagebox(s1)
        //---------------------------------------------------------------------------------
                   var s2=DL.InsertSQL("insert into whsw(myname) values(1)")
                   messagebox(s2)
        //---------------------------------------------------------------------------------
                   var s3=DL.UpdateSQL("update whsw set myname ='givl2' where id = 3")
                   messagebox(s3)
        //---------------------------------------------------------------------------------
                   var s4=DL.DeleteSQL("delete from whsw where id = 3")
                   messagebox(s4)
        //---------------------------------------------------------------------------------
                   var s5=DL.ExecSQL("insert into whsw VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        //---------------------------------------------------------------------------------
        end
        ret = DL.CloseMyDB  
        messagebox(ret)  

     //Oracle数据库
    var ret=DL.ConnectMyDB("Oracle", "账号", "密码", "localhost", "", 0)
        if(ret=1)
        var s1=DL.GetTable("SELECT top 10 * FROM people  ")
                messagebox(s1)
        //---------------------------------------------------------------------------------
                   var s2=DL.InsertSQL("insert into people(myname) values(1)")
                   messagebox(s2)
        //---------------------------------------------------------------------------------
                   var s3=DL.UpdateSQL("update people set myname ='givl2' where id = 3")
                   messagebox(s3)
        //---------------------------------------------------------------------------------
                   var s4=DL.DeleteSQL("delete from people where id = 3")
                   messagebox(s4)
        //---------------------------------------------------------------------------------
                   var s5=DL.ExecSQL("insert into people VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        //---------------------------------------------------------------------------------
        end
        ret = DL.CloseMyDB  
        messagebox(ret)     
end

回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-10-15 23:15:03 | 显示全部楼层

function button0_click()
        var path=sysgetcurrentpath()        
        var DL=com("DL.DLdb")
//---------------------------------------------------------------------------------
    //SQLite数据库
    var FilePath = path&"测试用的部分数据库文件\\test.db"
    var ret=DL.ConnectMyDB("SQLite", "", "", "",FilePath, 0)
        if(ret=1)
        var s1=DL.GetTable("SELECT * FROM people limit 0,10  ")
                                   messagebox(s1)

                   var s2=DL.InsertSQL("insert into people(myname) values(1)")
                   messagebox(s2)
        
                   var s3=DL.UpdateSQL("update people set myname ='givl2' where id = 3")
                   messagebox(s3)
        
                   var s4=DL.DeleteSQL("delete from people where id = 3")
                   messagebox(s4)
        
                   var s5=DL.ExecSQL("insert into people VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        
        end
        ret = DL.CloseMyDB  
        messagebox(ret)  
//---------------------------------------------------------------------------------
    //Access数据库
    var FilePath = path&"测试用的部分数据库文件\\my.accdb"
    var ret=DL.ConnectMyDB("Access", "", "", "localhost",FilePath, 0)
        if(ret=1)
        var s1=DL.GetTable("SELECT top 10 * FROM people ")
                   messagebox(s1)
        
                   var s2=DL.InsertSQL("insert into 本地学员(myname) values(1)")
                   messagebox(s2)
        
                   var s3=DL.UpdateSQL("update 本地学员 set myname ='givl2' where id = 3")
                   messagebox(s3)
        
                   var s4=DL.DeleteSQL("delete from 本地学员 where id = 1")
                   messagebox(s4)
        
                   var s5=DL.ExecSQL("insert into 本地学员 VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        
        end
        ret = DL.CloseMyDB  
        messagebox(ret)  
//---------------------------------------------------------------------------------
    //MySQL数据库
    var ret=DL.ConnectMyDB("MySQL", "root", "1234560", "localhost", "studb", 3306)
        if(ret=1)
        var s1=DL.GetTable("SELECT * FROM people limit 0,10  ")
                messagebox(s1)
        
                   var s2=DL.InsertSQL("insert into people(myname) values(1)")
                   messagebox(s2)
        
                   var s3=DL.UpdateSQL("update people set myname ='givl2' where id = 3")
                   messagebox(s3)
        
                   var s4=DL.DeleteSQL("delete from people where id = 3")
                   messagebox(s4)
        
                   var s5=DL.ExecSQL("insert into people VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        
        end
        ret = DL.CloseMyDB  
        messagebox(ret)  
//---------------------------------------------------------------------------------
     //SQL Server数据库
    var ret=DL.ConnectMyDB("SQL Server", "admin", "123456", "202.102.11.252", "datebase", 1433)
        if(ret=1)
        var s1=DL.GetTable("SELECT top 10 * FROM whsw  ")
                messagebox(s1)
        
                   var s2=DL.InsertSQL("insert into whsw(myname) values(1)")
                   messagebox(s2)
        
                   var s3=DL.UpdateSQL("update whsw set myname ='givl2' where id = 3")
                   messagebox(s3)
        
                   var s4=DL.DeleteSQL("delete from whsw where id = 3")
                   messagebox(s4)
        
                   var s5=DL.ExecSQL("insert into whsw VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        
        end
        ret = DL.CloseMyDB  
        messagebox(ret)  
//---------------------------------------------------------------------------------
     //Oracle数据库
    var ret=DL.ConnectMyDB("Oracle", "账号", "密码", "localhost", "", 0)
        if(ret=1)
        var s1=DL.GetTable("SELECT top 10 * FROM people  ")
                messagebox(s1)
        
                   var s2=DL.InsertSQL("insert into people(myname) values(1)")
                   messagebox(s2)
        
                   var s3=DL.UpdateSQL("update people set myname ='givl2' where id = 3")
                   messagebox(s3)
        
                   var s4=DL.DeleteSQL("delete from people where id = 3")
                   messagebox(s4)
        
                   var s5=DL.ExecSQL("insert into people VALUES('1','1','2','3','1','2')")
                   messagebox(s5)
        
        end
        ret = DL.CloseMyDB  
        messagebox(ret)     
end
回复 支持 反对

使用道具 举报

发表于 2018-1-1 15:28:28 | 显示全部楼层
顶一下,我还差的太远。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-7-24 19:52:17 | 显示全部楼层
QQ群 621816328
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条

关闭

小黑屋|TC官方合作论坛 (苏ICP备18045623号)

GMT+8, 2024-5-3 13:05 , Processed in 0.036827 second(s), 22 queries .

Powered by 海安简单软件服务部

© 2008-2019 版权所有 保留所有权利

快速回复 返回顶部 返回列表