Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
vb6.0 + mysql
#1


Please help!!! i have been creating a project based on vb6.0 and Mysql 5.51 as database.. i have created 36 tables out of this there is a one which can be called a master table and the left 35 tables are branch tables so i want to store data in master table and in branch tables as mention in the master tables so please help me out into this!! the code before this is -:
Private Sub cmdClear_Click()

Call ClearTextBoxes(Me)

End Sub

Private Sub cmdExit_Click()

End

End Sub

Private Sub cmdSave_Click()

Dim x As Date

x = CDate(Me.txtDate.Text = " yyyy-mm-dd ")

If Me.txtStartno.Text = "" Then

MsgBox "Please fill up the field!!"

Me.txtStartno.SetFocus

Exit Sub

End If

If Me.txtEndno.Text = "" Then

MsgBox "Please fill up the field!!"

Me.txtEndno.SetFocus

Exit Sub

End If

If Me.txtDate.Text = "" Then

MsgBox "Please fill up the field!!"

Me.txtDate.SetFocus

Exit Sub

End If


If Me.txtBrncode.Text = "" Then

MsgBox "Please fill up the field!!"

Me.txtBrncode.SetFocus

Exit Sub

End If

With Adodc1

.CommandType = adCmdText

Adodc1.Recordset.AddNew

Adodc1.Recordset.Fields(0) = Me.txtStartno.Text

Adodc1.Recordset.Fields(1) = Me.txtEndno.Text

Adodc1.Recordset.Fields(2) = x

Adodc1.Recordset.Fields(3) = Me.txtBrncode.Text

Adodc1.Recordset.Update

Adodc1.Refresh

DataGrid1.Refresh

MsgBox "Successfully added!"


End With

End Sub

Private Sub cmdSearch_Click()

Dim pcnl As ADODB.Connection

Dim rs As ADODB.Recordset

'Create a new instance of connection and recordset

Set pcnl = New ADODB.Connection

Set rs = New ADODB.Recordset

'Open connection

pcnl.Open " Provider=MSDASQL.1;Persist Security Info=False;User ID=root;Data Source=MYSQL;Mode=Read;Initial
Catalog=missing"


'Open recordset

Dim strSql As String

strSql = "SELECT * FROM Issue_Tab WHERE Startno LIKE " & "'" & txtSearch.Text & "'"

rs.Open strSql, pcnl, adOpenStatic, adLockOptimistic

'See if any records exist. If not exit sub and close connection and

'recordset. If yes, display data in text boxes

If rs.BOF = True Or rs.EOF = True Then

MsgBox "No records exist"

rs.Close

pcnl.Close

Exit Sub

Else

txtStartno.Text = rs!Startno

txtEndno.Text = rs!Endno

txtDate.Text = rs!Issuedate

txtBrncode.Text = rs!Brncode

rs.Close

pcnl.Close


End If


End Sub

Private Sub cmdShow_Click()

Adodc1.RecordSource = " select * from Issue_Tab "

Adodc1.Refresh

End Sub





Private Sub cmdUpdate_Click()


Adodc1.Recordset.Update

Adodc1.Refresh

Adodc1.Recordset("Startno").Value = Me.txtStartno.Text

Adodc1.Recordset("Endno").Value = Me.txtEndno.Text

Adodc1.Recordset("Issuedate").Value = Me.txtDate.Text

Adodc1.Recordset("Brncode").Value = Me.txtBrncode.Text

End Sub

Private Sub DataGrid1_AfterDelete()

MsgBox " Record Deleted!!! "

End Sub

Private Sub DataGrid1_AfterInsert()

MsgBox " Record is added"

End Sub

Private Sub DataGrid1_AfterUpdate()

MsgBox " Record Updated!!! "

End Sub
so please help me out
PirateOmg
Reply
#2
in vb6 mysql weird: Ddddddd Big Grin
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Creating and inserting data into a PHP and MySQL Database Peter L 9 4,019 03-24-2012, 10:49 AM
Last Post: Haxalot
  VB.NET MySql , Help please booterphhp 2 1,684 03-19-2012, 11:13 AM
Last Post: RainbowDashFTW
  [TUT] Include mySQL into php. MyNameIs940 48 22,779 01-14-2012, 04:45 PM
Last Post: Strafeness
  MySQL (Innodb vs MyISAM) Omniscient 15 9,472 07-22-2011, 03:15 PM
Last Post: developer99
  MySQL question ImFocuzz 8 2,673 07-17-2011, 06:57 PM
Last Post: Pedo bear

Forum Jump:


Users browsing this thread: 1 Guest(s)