主题:紧急!大家帮忙看看`++30
[em10]
知道服务器IP 218.*.*.* ,sa和密码1***,数据库 student 表account
怎么连接这台远程电脑的SQL数据库``并且在account里面插入一个用户`
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.ConnectionString = "Driver={sql server};server=218.*.*.*;uid=sa;pwd=***;database=student"
conn.CursorLocation = adUseClient
conn.Open
sql = "insert into TBL_ACCOUNT(ACCOUNT,PASSWORD)values('lqh201','6585201')"
rs.Open sql, conn, adOpenKeyset, adLockOptimistic
MsgBox "注册成功!"
我用上面这段代码``运行后等了好一会儿,才说sql server不存在或访问被拒绝
大家帮写个正确的
知道服务器IP 218.*.*.* ,sa和密码1***,数据库 student 表account
怎么连接这台远程电脑的SQL数据库``并且在account里面插入一个用户`
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.ConnectionString = "Driver={sql server};server=218.*.*.*;uid=sa;pwd=***;database=student"
conn.CursorLocation = adUseClient
conn.Open
sql = "insert into TBL_ACCOUNT(ACCOUNT,PASSWORD)values('lqh201','6585201')"
rs.Open sql, conn, adOpenKeyset, adLockOptimistic
MsgBox "注册成功!"
我用上面这段代码``运行后等了好一会儿,才说sql server不存在或访问被拒绝
大家帮写个正确的