Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 14th, 2004, 09:35 PM
KaptainKarst KaptainKarst is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 6 KaptainKarst User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 43 sec
Reputation Power: 0
Datagrid: missing first cell data

visual basic 6.0

I'm performing running an sql and populating a datagrid upon form load.

I have placed on the form an ADO control (adodc1) and a datagrid (datagrid1).

I'm setting the properties of both via code.

The code works and the datagrid is populated except for the first cell in the first column and first row. All other cells are just fine. It does not matter how I arrange the sql (yes there are values in the database fields).

what is going on?

Here is the code:

Private Sub Form_Load()
Dim mySql As String
Dim ConStr As String

ConStr = "Provider=Microsoft.jet.oledb.4.0;data source =" & (App.Path & "\booktracks.mdb")
mySql = "select * from books"

Adodc1.ConnectionString = ConStr
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = mySql
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1.Recordset
End Sub

If I set the adodc1 connection string at design time and also set the datagrid datasource at design time, ALL cells are populated correctly.

What is the difference or what am I doning wrong? I need to set the connection string of the database at run time to be sure that the path to the database is correct.

Any suggestions?
Thanks,
Jim

Reply With Quote
  #2  
Old January 14th, 2004, 11:05 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
You could try leaving out the adodc1.refresh & see if it helps

Reply With Quote
  #3  
Old July 23rd, 2005, 09:34 AM
Gary O'Connor Gary O'Connor is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Location: Cookamidgera, a little village in the centre of New South Wales, Australia. Sydney is my states capital city.
Posts: 5 Gary O'Connor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 2 m
Reputation Power: 0
You need to go to the Custom settings of your datagrid then goto 'Splits' and set the 'Locked' value to on.

You could, if you wanted to, add a line like this prior to loading your database

datagrid1.Splits(0).Locked = True

Then, every time you want to edit the datagrid you should use a line like the following....

datagrid1.AllowUpdate = True
datagrid1.Splits(0).Locked = False

Once your edit is done lock it up again to keep it all safe.

datagrid1.AllowUpdate = False
datagrid1.Splits(0).Locked = True

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Datagrid: missing first cell data


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT