注册 登录
编程论坛 SQL Server论坛

未发现数据源名称

xywnhy 发布于 2010-04-12 12:05, 798 次点击
提示我:未发现数据源名称,未指定默认驱动程序

Dim conn As ADODB.Connection
  Dim rst As ADODB.Recordset
  
  Set conn = New ADODB.Connection
  conn.ConnectionString = "priovider=sqloledb;driver=(sql server);" + _
     "server=WWW-D4CC14DD61C;uid=sa;pwd=xywnhy2005;database=wudianchangyong"
  conn.Open

  Set rst = New ADODB.Recordset
  Set rst.ActiveConnection = conn
  rst.CursorLocation = adUseClient
  rst.CursorType = adOpenDynamic
  rst.LockType = adLockPessimistic
  rst.Open "select d.xinghao,d.zuzhi" + _
            "from dianzu d" + _
            "where d.xinghao=d.xinghao and d.zuzhi=d.zuzhi" + _
            "order by d.xinghao"
  rst.MoveFirst
  Text1.Text = "xinghao   zuzhi" + Chr(13) + Chr(10)
  While Not rst.EOF
     Text1.Text = Text1.Text + rst.Fields(0) + " " + _
     Format(rst.Fields(2), "###") + Chr(13) + Chr(10)
     rst.MoveNext
  Wend

  Set rst = Nothing
  Set conn = Nothing



急求啊~~~~~~~~~·,小弟新手,谢过~~~~~~~~~~~~··
2 回复
#2
czyzhuo2010-04-12 13:01
conn.ConnectionString = "priovider=sqloledb;driver=(sql server);" + _
     "server=WWW-D4CC14DD61C;uid=sa;pwd=xywnhy2005;database=wudianchangyong"
連接字符串有錯
#3
xywnhy2010-04-12 13:20
3Q
1