SunQuest
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual 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 Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old July 6th, 2003, 05:27 PM
Bobba Buoy Bobba Buoy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 51 Bobba Buoy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 42 sec
Reputation Power: 6
The current row is not available.

I get this error message when I try to edit a datagrid that is bound to a sql server database. Any ideas?

Thanks!

Reply With Quote
  #2  
Old July 7th, 2003, 07:13 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
How was your cursor opened? Forward only? Updateable?

Reply With Quote
  #3  
Old July 7th, 2003, 07:15 PM
Bobba Buoy Bobba Buoy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 51 Bobba Buoy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 42 sec
Reputation Power: 6
adOpenStatic

And I only get the error on this field. I can update other fields as needed.

Reply With Quote
  #4  
Old July 7th, 2003, 07:36 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
What is the data type for the field?

Reply With Quote
  #5  
Old July 7th, 2003, 07:38 PM
Bobba Buoy Bobba Buoy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 51 Bobba Buoy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 42 sec
Reputation Power: 6
Its a varchar type in ms sql server.

Reply With Quote
  #6  
Old July 7th, 2003, 07:48 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
Can you edit any other VARCHAR fields in this same row?

Reply With Quote
  #7  
Old July 7th, 2003, 07:51 PM
Bobba Buoy Bobba Buoy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 51 Bobba Buoy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 42 sec
Reputation Power: 6
Yes, with no problem. The interesting thing is, though, that this grid is bound to the data source in code (rather than with an adodc) and is sitting on a mdichild form. When I edit other fields I run some validation on them and sometimes the msg box that indicates the user has entered incorrect data doesn't show up. I think it is behind the child form? I don't know but I hear the beep and if I hit enter the program continues to run.

Pretty bizarre I think.

Reply With Quote
  #8  
Old July 7th, 2003, 11:42 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
Are there any data constraints, checks or Foreign key relationships on the target field? Can you update field directly or through a query?

Reply With Quote
  #9  
Old July 8th, 2003, 06:17 AM
Bobba Buoy Bobba Buoy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 51 Bobba Buoy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 42 sec
Reputation Power: 6
Here is the query that I use to populate the grid with:

[vb]

'get data source for display
sql = "SELECT * FROM PartData pd INNER JOIN RaceData rd ON pd.RaceID = rd.RaceID "
sql = sql & "WHERE rd.EventID = " & lEventID & " ORDER BY pd.LastName"
Set rs = New Recordset
rs.Open sql, conn, adOpenStatic, adLockOptimistic
Set dgPartData.DataSource = rs

[/vb]

Here is how I write to the recordset itself:

[vb]

'insert into db
sql = "INSERT INTO PartData (RaceID, FirstName, LastName, Bib, Gender, Age, Address, "
sql = sql & "City, State, Zip, Phone, Email, ShrtSize, ShrtStyle, WhereReg, DateReg, "
sql = sql & "DOB, Team, Seed, SeedTime, AmtPaid, AgeGroup, Clydesdale, Wheelchair, RaceWalk) "
sql = sql & "VALUES (" & ThisRaceID(lstRace, lstRace.Text) & ", '" & txtFirstName & "', '"
sql = sql & txtlastName & "', '" & txtBib & "', '" & lstGender & "', " & RaceDayAge & ", '"
sql = sql & txtAddress & "', '" & txtCity & "', '" & txtState & "', "
sql = sql & lZip & ", '" & txtPhone & "', '" & txtEmail & "', '" & lstShrtSize & "', '"
sql = sql & lstShrtStyle & "', '" & lstWhereReg & "', '" & Date & "', '" & txtDOB & "', '"
sql = sql & txtTeam & "', '" & txtSeed & "', '" & txtSeedTime & "', '" & txtEntryFee & "', '"
sql = sql & AgeGrp(RaceDayAge, lstGender.Text, ThisRaceID(lstRace, lstRace.Text)) & "', '"
sql = sql & sClyde & "', '" & sWhlchr & "', '" & sRaceWalk & "')"
Set rs = conn.Execute(sql)

[/vb]

All of this seems to work fine (except the gird is quirkly as I said in my last reply) except when I try to edit this field directly on the grid-that is when I get an error.

Please don't hesitate to comment on my code if you think it could/should be written differently.

Thanks!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > The current row is not available.


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 3 hosted by Hostway