各位幫我看看這段程式碼vb連線sql的問題

Private Sub Form_Load()
Dim CN As New adodb.Connection ’定義資料庫的連線存放資料和程式碼
Dim rs As New adodb.Recordset
CN.ConnectionString = ”Provider=sqloledb;Data Source=HEBEIDAI-32CDD8;Initial Catalog=vote;User Id=sa;Password=”
CN.Open
rs.CursorLocation = adUseClient
rs.Open ”select * from jiemu group by jiemumingcheng”, CN, adOpenDynamic, adLockOptimistic
Set DataGrid1.DataSource = rs
End Sub
施昱銓
2022-08-01 13:54:01
  • 0

  • 21 點閱

  • 0 評論

其他人的答案

Copyright © 2024 https://hiqna.com 中華Hi知識