Empty row in Datagrid

Tubibtoon
10-06-2001, 06:45 AM
I have a problem with Datagrid. I use a ADODC in combination with Datagrid, but when I activate the datagrid, I get a extra row (row 1) which is empty. How can I get rid of this extra useless (empty) row.

My code:

Const sSql = "SELECT * FROM xTable ORDER BY yField"

Adodc1.LockType = adLockOptimistic
Adodc1.CursorType = adOpenDynamic
Adodc1.RecordSource = App.Path & "\data\algemeen.mdb
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path & "\data\Algemeen.mdb"

selecteer (sSql)


Function selecteer(ByVal sSql As String)
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = sSql
Adodc1.Refresh
End Function

Please help me!
Thanks in advance.

Thinker
10-06-2001, 11:15 AM
If you are talking about the blank row at the end with the * in the left,
that is so that you can add new records. If you don't want to add new
records, then set the AllowAddNew property of the datagrid = False.

I think therefore I am... sometimes right. images/icons/wink.gif

Tubibtoon
10-07-2001, 07:06 AM
It is not the blank row(*) at the end of the datagrid but a new blank row at the beginning of the datagrid.

Banjo
10-07-2001, 07:46 AM
Have you checked that the original DB table does not have this extra line. This would creep through because you are selecting everythin from the table.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum