0
Private Sub cmdAdd_Click()


Dim rs As ADODB.Recordset

Dim strsql As String

strsql = "insert into Issue_Tab(Startno, End no, Issuedate, Brncode) Values( ' " & txtstartno.Text & " ' , ' " & 
txtendo.Text & " ' , ' " & txtdate.Text & " ' , where Brncode = ' " & txtbrncode.Text & " '  ) "

Set rs = pcnl.Execute(strsql)

Set rs = Nothing

MsgBox " Saved"

Me.filllistview

End Sub

Sub filllistview()

strsql = "select * from Issue_Tab"

Set rs = pcnl.Execute(strsql)

ListView1.ListItems.Clear

Do While Not rs.EOF

Set Item = ListView1.ListItems.Add(, , rs!Startno)

Item.SubItems(1) = rs!Endno & ""

Item.SubItems(2) = rs!Issuedate & ""

Item.SubItems(3) = rs!Brncode & ""

rs.MoveNext

Loop

Set rs = Nothing

End Sub


Private Sub Command1_Click()

Dim strsql As String

Dim rs As ADODB.Recordset

strsql = " Delete from Issue_tab where Brncode = ' " & txtbrncode.Text & " ' "

Set rs = pcnl.Execute(strsql)

Set rs = Nothing

MsgBox "Delete"

Me.filllistview

End Sub

Private Sub Form_Load()

Me.filllistview

End Sub


Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)

With Item

txtstartno.Text = Item

txtendno.Text = .SubItems(1)

txtdate.Text = .SubItems(2)

txtbrncode.Text = .SubItems(3)

End With

End Sub



Private Sub txtupdate_Click()

Dim strsql As String

Dim rs As ADODB.Recordset

strsql = " update Issue_Tab set startno = ' " & txtstartno.Text & " ' , Endno = ' " & txtendno.Text & " ' , Issuedate = ' " & txtdate.Text & " '  where Brncode = ' " & txtbrncode.Text & " ' "

Set rs = pcnl.Execute(strsql)

Set rs = Nothing

MsgBox " Updated"

Me.filllistview

End Sub

“”“”我在我的项目中进行了此编码,并且我也确实在其中添加了模块....但是编码的问题是它既没有显示任何错误,也没有工作,也没有显示我的数据库中的更改sql.....所以请尽快帮助我,因为我必须在公司提交项目.......

提前感谢..帮助我进入这个..!

4

1 回答 1

0

我有几个问题可以最好地揭示您的问题:

  1. 首先,您应该检查 mysql 日志,它们是否已启用?
  2. mysql甚至在运行吗?
  3. 你的mysql是怎么安装的?是香草吗?
  4. 您是否为 ODBC 安装了 MySQL 插件?
  5. 您的控制台/动态日志是否在 vb6 上启用?尝试一些回声以查看发生了什么。
于 2012-08-28T09:13:56.477 回答