使用VB怎么能把本地的SQL数据库传到远程的SQL中?
答案:2 悬赏:40 手机版
解决时间 2021-03-01 03:41
- 提问者网友:记得曾经
- 2021-02-28 08:15
使用VB怎么能把本地的SQL数据库传到远程的SQL中?
最佳答案
- 五星知识达人网友:痴妹与他
- 2021-02-28 09:41
确定你的空间有数据服务连接
源错误:
行 29: ConnectionStringSettings setting = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"];
行 30: myCon.ConnectionString = setting.ConnectionString;
行 31: myCon.Open();
行 32:
行 33: //2 使用SqlCommand提交查询命令
源文件: d:\wwwroot\3g1008688_com\web\Default2.aspx.cs 行: 31
这里你的文件没有上传到服务器,重新检查下数据库操作的文件有没有上传完整
源错误:
行 29: ConnectionStringSettings setting = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"];
行 30: myCon.ConnectionString = setting.ConnectionString;
行 31: myCon.Open();
行 32:
行 33: //2 使用SqlCommand提交查询命令
源文件: d:\wwwroot\3g1008688_com\web\Default2.aspx.cs 行: 31
这里你的文件没有上传到服务器,重新检查下数据库操作的文件有没有上传完整
全部回答
- 1楼网友:七十二街
- 2021-02-28 10:13
vb连接sql模块。直接拿去用吧。 public conn as new adodb.connection public rs as new adodb.recordset public addflag as boolean public function opencn(byval cip as string) as boolean dim mag as string on error goto strerrmag set conn = new adodb.connection conn.connectiontimeout = 25 conn.provider = "sqloledb" conn.properties("data source").value = cip '服务器的名字 conn.properties("initial catalog").value = "zqoa" '库名 'conn.properties("integrated security").value = "sspi" '登陆类型 conn.properties("user id").value = "sa" conn.properties("password").value = "sa" conn.open opencn = true addflag = true exit function strerrmag: mag = "data can't connect" call msgbox(mag, vbokonly, "error:data connect") addflag = false exit function end function public sub clocn() on error resume next if conn.state <> adstateclosed then conn.close set conn = nothing end sub public function openrs(byval strsql as string) as boolean '连接数据库记录集 dim mag as string dim rpy as boolean on error goto strerrmag set rs = new adodb.recordset if addflag = false then rpy = true with rs .activeconnection = conn .cursorlocation = aduseclient .cursortype = adopenkeyset .locktype = adlockoptimistic .open strsql end with addflag = true openrs = true end 'exit function strerrmag: mag = "data not connect" call msgbox(mag, vbokonly, "error:connect") openrs = false end 'exit function end function public sub clors() on error resume next if rs.state <> adstateclosed then rs.clone set rs = nothing end sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯