Jump to content

bosco

Members
  • Posts

    2
  • Joined

  • Last visited

bosco's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. bosco

    how to connect forms

    what kind of connection do you need?if you want to open another form, in the button_click event you writeForm2.showif you want the data from one form to be transfered to another form you write in the form_load event of that formForm2.Text=Form1.Text1.Text
  2. I am new in asp programming, have experience in visual basic programming,I have this problem in converting my visual basic program to asp or visualbasicscript. The case is like this, I have a database with table consisting of the list of the number combination( 6 combinations), I have another table consisting of the winning combination, I want to make a code that will check the list of combination with that of the winning number and also find out how many numbers are the same with the winning combinations. Can anybody help me in coding in asp or visualbasicscript.here is the code in visual basic that is working;Private Sub cmdCheck_Click()On Error Resume NextDim stDate As String'Dim t(5)stDate = txtDate.TextDim lngRecCount As IntegerDim lngCounter As IntegerSet rstBet = New ADODB.RecordsetrstBet.Open "SELECT listahan.d1, listahan.d2, listahan.d3, listahan.d4, listahan.d5, listahan.d6, listahan.date, listahan.lagay FROM listahan;", db, adOpenStatic, adLockOptimisticrstBet.Filter = "[date]=#" & stDate & "#"With rstBet If .RecordCount > 0 Then stRecord = rstBet.RecordCount .MoveFirst For i = 1 To .RecordCount t(0) = rstBet![d1] t(1) = rstBet![d2] t(2) = rstBet![d3] t(3) = rstBet![d4] t(4) = rstBet![d5] t(5) = rstBet![d6] Call IlanTama .MoveNext Next i Else End IfEnd With MsgBox "tapos na ang pagcheck ng mga taya"End SubPrivate Sub cmdLoad_Click()On Error Resume NextDim stDate As StringstDate = txtDate.TextDim lngRecCount As IntegerDim lngCounter As IntegerDim rstTaya As ADODB.RecordsetSet rstTaya = New ADODB.RecordsetrstTaya.Open "SELECT win_42.d1, win_42.d2, win_42.d3, win_42.d4, win_42.d5, win_42.d6, win_42.petsa From win_42", db, adOpenStatic, adLockOptimisticrstTaya.Filter = "[petsa]=#" & stDate & "#"With rstTaya If .RecordCount > 0 Then stRecord = rstTaya.RecordCount .MoveFirst For i = 1 To .RecordCount If stDate = rstTaya![petsa] Then foundFlag = True .MoveFirst d(0) = rstTaya![d1] d(1) = rstTaya![d2] d(2) = rstTaya![d3] d(3) = rstTaya![d4] d(4) = rstTaya![d5] d(5) = rstTaya![d6] i = .RecordCount End If If foundFlag = False Then .MoveNext End If Next i If foundFlag = True Then 'MsgBox "Record has been located!" Else MsgBox "No Match in database!" foundFlag = False .MoveFirst End If Else MsgBox "Circuit is not listed in database!" foundFlag = False End If End With End SubPrivate Sub Form_Load()Set db = New Connectiondb.CursorLocation = adUseClient db.Open "PROVIDER=MSDataShape;Data PROVIDER=" & _ "Microsoft.Jet.OLEDB.4.0;Data Source=" _ & App.Path & "\gkb.mdb;"End SubPrivate Function IlanTama()Dim mybet As DoubleDim ilanpanalo As Integer'ReDim t(5)ilanpanalo = 0Dim x ' first digit tamaDim y ' first digit tayaFor x = 0 To 5 For y = 0 To 5 If d(x).Text = t(y).Text Then ilanpanalo = ilanpanalo + 1 End If NextNextSelect Case ilanpanaloCase Is = 0, 1, 2 rstBet![lagay] = "talo" rstBet.UpdateCase Is = 3 rstBet![lagay] = "balik taya" rstBet.UpdateCase Is = 4 rstBet![lagay] = "800" rstBet.UpdateCase Is = 5 rstBet![lagay] = "20000" rstBet.UpdateCase Is = 6 rstBet![lagay] = "Jackpot" rstBet.UpdateEnd SelectEnd Function
×
×
  • Create New...