• 0

$5 to the person that can fix this(VB)


Question

I NEED to have this program fixed, i cant get it to write to this stupid access database file :angry:

I will pay using paypal to the person that can get it to write to the rps.mdb file

One note, don't convert the access file to 2000, leave it in its current formatting..

Any questions PM me.

Thanks

Steve

help_me_neowin_.zip

Link to comment
https://www.neowin.net/forum/topic/151040-5-to-the-person-that-can-fix-thisvb/
Share on other sites

13 answers to this question

Recommended Posts

  • 0

The point where it is wrong is (i think) the writing to the database

"Private Sub cmdWrite_Click()

'write results to database

'Set Adodc1 = New ADODB.Connection

If R1_Win = 5 Then

Adodc1.RecordSource = "INSERT into rps (RealName1, RealName2, VictorRealName, Losses)" & _

"VALUES ('" & Real1 & "', '" & Real2 & "', '" & Winner & "', " & R2_Win & ")"

Else

Adodc1.RecordSource = "INSERT into rps (RealName1, RealName2, VictorRealName, Losses)" & _

"VALUES ('" & Real1 & "', '" & Real2 & "', '" & Winner & "', " & R1_Win & ")"

End If

'display results were written

MsgBox "Results Written to rps.mdb", vbInformation, "Database Write"

End Sub

If you know VB this should be an easy problem

I'm just to retarted to get it right

I am TOTALLY serious about the money too, I really need this fixed

-steve

  • 0

You need to test your strings for null values. Real1 and Real2 come up emtpy each time for me.

       Dim adoCmd As ADODB.Command
        Dim adoConn As ADODB.Connection
        Set adoConn = New ADODB.Connection
        adoConn.ConnectionString = Adodc1.ConnectionString
        adoConn.Open
        Set adoCmd = New ADODB.Command
        
        adoCmd.ActiveConnection = adoConn
        If Real1 = "" Then
            Real1 = "n/a"
        End If
        
        If Real2 = "" Then
            Real2 = "n/a"
        End If
        
        If R1_Win = 5 Then
            adoCmd.CommandText = "INSERT into rps (RealName1, RealName2, VictorRealName, Losses)" & _
            "VALUES ('" & Real1 & "', '" & Real2 & "', '" & Winner & "', " & R2_Win & ")"
        Else
            adoCmd.CommandText = "INSERT into rps (RealName1, RealName2, VictorRealName, Losses)" & _
            "VALUES ('" & Real1 & "', '" & Real2 & "', '" & Winner & "', " & R1_Win & ")"
        End If
        
        adoCmd.Execute
        'display results were written
        MsgBox "Results Written to rps.mdb", vbInformation, "Database Write"
        adoConn.Close
        Adodc1.Refresh

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.