Click to See Complete Forum and Search --> : GetDate, DeleteData
MartinLiss
Jan 31st, 2000, 12:39 AM
First of all, a couple of questions. Does your table have a key? If it does, is the key data shown in the grid? If it is, then deleting the row is easy with code like this from one of my programs:SQL = "DELETE FROM SavedSystems WHERE SystemName = " & "'" & sSysName & "'"
gdbRWTU.Execute SQL, dbFailOnError. You would have to change it to match your database and table of course, and substitute the data in the grid that represents the table's key for sSysName.
Another question is why do you display the text? Why not delete the data depending on a row in the grid that the user clicks?
Finally, there is a small problem in your code to display the text. You wind up with "--" at the beginning of the string. One way to avoid that would be to modify your loop like this.For intI = 0 To MSFlexGrid1.Cols - 1
MSFlexGrid1.Col = intI
If intI > 0 Then
strTemp = strTemp & "--" & MSFlexGrid1.Text
Else
strTemp = MSFlexGrid1.Text
End If
Next intI
------------------
Marty
COGITO EGGO SUM
I think; therefore I am a waffle.
mecca
Jan 31st, 2000, 02:02 AM
Currently the table DOES NOT have a primary key value. I've thought about adding a key as an autonumber, but how would that work if multiple users are accessing the database? I used the "--" to separate the column values..Also, I wanted frmQuery(form2) to display the info from the selected row so the user could edit, delete, "checkout" or check off that particular "todo" for the day. Any suggestions as to a primary key value, or would the autonumber work as a key? Thanks.
MartinLiss
Jan 31st, 2000, 03:25 AM
Let me suggest that you buy a book titled Doing Objects in Microsoft Visual Basic 5.0 by Deborah Kurata. It is one of the best books I've read. I think it would be particularly appropriate for you, because she has the reader build and improve a Todo List application in the various chapters of the book.
------------------
Marty
COGITO EGGO SUM
I think; therefore I am a waffle.
mecca
Jan 31st, 2000, 03:56 AM
Thank you for the book suggestions, but what about now?
MartinLiss
Jan 31st, 2000, 09:42 AM
I'm not an expert in multiuser database apps so I can't give you much advice on that subject. I know however that you will need to develop a locking scheme if more than one user will be accessing the same todo table. But my main point is that todo programs have been done many times by better programmers than you or I, so why reinvent the wheel?
------------------
Marty
COGITO EGGO SUM
I think; therefore I am a waffle.
mecca
Jan 31st, 2000, 11:50 AM
Hi All,
Here's the code on frmSplash(form1):
Dim intI As Integer, strTemp As String
For intI = 0 To MSFlexGrid1.Cols - 1
MSFlexGrid1.Col = intI
strTemp = strTemp & "--" & MSFlexGrid1.Text
Next intI
frmViewRow.txtViewRow = strTemp
Okay, now frmQuery(form2) view the entire string of strTemp into txtViewRow. I want the user to be able to delete the row in the database, but I'm not sure how to go about doing this? Is there a way to pull the data as variables and then I can plug them into my query? Any suggestions? I said date in the subject, I meant data...
Thanks,
Dave
[This message has been edited by mecca (edited 01-31-2000).]
[This message has been edited by mecca (edited 01-31-2000).]
mecca
Jan 31st, 2000, 09:21 PM
That's a stupid gesture. How do you think I will learn better programming skills if I don't pick up an idea and run with it? Thanks, but no thanks for the help. Try to be more positive on your future posts.
MartinLiss
Feb 1st, 2000, 01:22 AM
I don't know what you mean by a "stupid gesture". One of the only "stupid gestures" I can think of involves the middle finger of your hand, but perhaps you meant "stupid suggestion". In any case I seem to have offended you and that certainly wasn't my intention. While you can definately learn things on your own by trial and error, you can also learn from books.
------------------
Marty
COGITO EGGO SUM
I think; therefore I am a waffle.
mecca
Feb 1st, 2000, 01:30 AM
The mere "act" of you implying that I re-invent the wheel is a "stupid gesture." Now rethink the statement and try, if you can, understand exactly what I meant by "stupid gesture."
JHausmann
Feb 1st, 2000, 02:47 AM
Originally posted by mecca:
The mere "act" of you implying that I re-invent the wheel is a "stupid gesture." Now rethink the statement and try, if you can, understand exactly what I meant by "stupid gesture."
First of all, Marty's not implying anything, he asked a you question.
Secondly, he's advising you to _not_ re-invent the wheel by his wording.
Lastly, you'll find people will be more likely to answer your questions if you don't punish them for doing so.
mecca
Feb 1st, 2000, 03:05 AM
Both of you are taking this out of porportion. MartinLiss began helping me and then suggested that I read a book. That's fine, but maybe I needed a little help now so I wouldn't have to run out and buy a book just yet. Then MartinLiss proceeded to tell me to re-invent the wheel, that's not helping, go figure. Further, JHausmann, why is this your business anyway? If you'll read all my prior posts, I'm always friendly and thankful for any help I get, so why has this particular post turned sour w/o pointing the finger at me?
JHausmann
Feb 1st, 2000, 03:28 AM
Marty and I are co-workers, separated by a wall. The book Marty suggested will teach you OOP and VB, as well as provide you with all the source code you'll need to do a "todo" project. If you read Marty's post you'll see that he's suggesting you use _that_ code so that _you_ don't have to re-invent the wheel.
It is easy to interpret your post "That's a stupid gesture" to be "That was a stupid answer" which is far from friendly or thankful. That's also the point the thread degenerated into a free-for-all.
mecca
Feb 1st, 2000, 03:35 AM
Great then, we're all on the same page. End of story, let's move on. I'll certainly take Marty's book suggestion into consideration. Thanks.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.