Hi,
What is the select command for SxAdapter?
Ken
--------------------------
> When I go to update my datagridview...I get this error
>
[quoted text clipped - 10 lines]
>
> Any ideas?
Here is my GetData mod
Private Sub GetData(ByVal selectCommand As String)
Try
Dim Cxx As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source= " & Application.StartupPath & "\zAdmin.mdb;User Id=admin;Password=;"
SQL = "Select LastName, FirstName, Date, Score from Scores"
' Create a new data adapter based on the specified query.
SxAdapter = New OleDbDataAdapter(SQL, Cxx)
Dim MyCommandBuilder As New OleDbCommandBuilder(SxAdapter)
Dim SxTable As New DataTable()
SxTable.Locale = System.Globalization.CultureInfo.InvariantCulture
SxAdapter.Fill(SxTable)
SxSource.DataSource = SxTable
Catch ex As OleDbException
MessageBox.Show("Error")
End Try
End Sub
> When I go to update my datagridview...I get this error
>
[quoted text clipped - 9 lines]
>
> Any ideas?
Ken Tucker [MVP] - 27 Nov 2006 01:43 GMT
Hi,
I think date is an keyword. Try this for the select statement
SQL = "Select LastName, FirstName, [Date], Score from Scores"
Ken
------------------
> Here is my GetData mod
>
[quoted text clipped - 31 lines]
>>
>> Any ideas?
Arne Beruldsen - 27 Nov 2006 02:31 GMT
Good thought but still didn't work...I even changed the column to
TestDate...still no luck...:(
I'm stumped
> Hi,
>
[quoted text clipped - 39 lines]
> >>
> >> Any ideas?
RobinS - 27 Nov 2006 03:45 GMT
VB2005 or 2003?
Robin S.
--------------------------------
> Here is my GetData mod
>
[quoted text clipped - 31 lines]
>>
>> Any ideas?
RobinS - 27 Nov 2006 03:50 GMT
Do you have Option Strict On and Option Explicit On, just to make sure
all of your variables are defined, and correctly?
Where are Sql, SxAdapter, and SxSource defined, and as what?
Robin S.
-------------------------
> Here is my GetData mod
>
[quoted text clipped - 31 lines]
>>
>> Any ideas?
Arne Beruldsen - 27 Nov 2006 04:29 GMT
Defined as...
Private SxAdapter As New OleDbDataAdapter()
Private SxSource As New BindingSource()
> Do you have Option Strict On and Option Explicit On, just to make sure
> all of your variables are defined, and correctly?
[quoted text clipped - 39 lines]
> >>
> >> Any ideas?