Problem with data control 
Author Message
 Problem with data control

SI->Do While Data1.Recordset.EOF = False
  ->grid1.Rows = gridrow + 1
  ->grid1.Row = gridrow
  ->grid1.Col = 0
  ->grid1.Text = Data1.Recordset("status")
  ->grid1.Col = 1
  ->grid1.Text = Data1.Recordset("type")
  ->grid1.Col = 2
  ->grid1.Text = Data1.Recordset("nm_sort")
  ->grid1.Col = 3
  ->grid1.Text = Data1.Recordset("ad_street")

SI->Data1.Recordset.MoveNext
  ->gridrow = gridrow + 1
  ->Loop

SI->The problem is, when ever any field in the database is
  ->null, I get an error saying "Invalid use of null".For
  ->example if the "ad_street" field is empty in my database, I
  ->get the error. Is there a way to resolve this error?

You can simply add an & "" to the end of your database fields
Example: grid1.text=data1.recordset("ad_street") & ""

This will eliminate your null trouble, if it a numeric field add + 0.

Also, You can load a grid quicker if you use the additem method on the
grid and separate the string in each column by tabs
example:

grid1.cols=3
for i%=0 to 5
  t$="col 1 " & chr$(9) & "col 2" & chr$(9) & "col 3"
  grid1.additem t$
Next I%

This will add 6 rows quickly to a grid 3 columns wide.

Good luck

---
 t 1st 1.10 #7614 t



Tue, 23 Dec 1997 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Problems with data control in VB 4.0 and ODBC data sources

2. Problem with Data control or DBList control?

3. Problem with Data Control??

4. Problem with Data Control

5. Problem with Data control

6. Recordset - Bookmark Problem with Data control

7. Problem initializing data control

8. MSRDC20.OCX update problem (Remote Data Control)

9. Problem with Data-Control

10. Nulls Problem with Data Control

11. PROBLEM HELP - Data control on one form and dblist on the other

12. Odd problem with data control refresh

 

 
Powered by phpBB® Forum Software