• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

.net web service question

Liviathan

Platinum Member
Trying to add some data to an access DB

<WebMethod()> Public Sub SaveBet(ByVal BetDate As Date, ByVal SportID As Integer, ByVal AwayTeamID As Integer, ByVal HomeTeamID As Integer, ByVal BetTypeID As Integer, ByVal TeamBet As Integer, ByVal SpreadPoints As Double)

Dim strDBPath As String = "C:\$User\Dev\WinBetTracker\Data\WinBetTracker.mdb"
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath
Dim strSQL As String

Dim objConn As OleDbConnection
Dim objCmd As OleDbCommand

objConn = New OleDbConnection(strConn)
objConn.Open()

strSQL = "INSERT INTO TBL_Bets (GameDate, Sports_ID, AwayTeam_ID, HomeTeam_ID, BetType_ID, BetTeam_ID, Spread_Points) VALUES (#" & BetDate & "#," & SportID & "," & AwayTeamID & "," & HomeTeamID & "," & BetTypeID & "," & TeamBet & "," & SpreadPoints & ")"
'strSQL = "INSERT INTO TBL_BETS (GameDate, Sports_ID, AwayTeam_ID, HomeTeam_ID, BetType_ID, BetTeam_ID, Spread_Points) VALUES (#10/30/2002#,2,17,21,0,17,1)"
objCmd = New OleDbCommand(strSQL, objConn)

objCmd.ExecuteNonQuery()

End Sub


whats wrong with this?? I get an error message that it must be an updatable query. I am just starting out in .net and I am just trying to do a basic command here. Any help would be appreciate it.
thanks
 
Back
Top