Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > General Question


Reply
 
Thread Tools Display Modes
  #1  
Old 06-21-2003, 07:21 PM
mannyso mannyso is offline
Centurion
 
Join Date: Oct 2002
Location: Canada
Posts: 171
Default General Question


Somebody wrote this example for me but I do not understan this SQL Statement.

This procedure supose to read data from a DBGrid each column and write to the Database in a recordset.

With DBGrid1
'dimensions of a variable, based on number of colums
ReDim RowContents(.Cols)

'All the cells of a row are read into RowContents variable and then
'put into a database. After one row is processed, we proceed to the
'next one
For i = 0 to .Rows - 1
.Row = i
For j = 0 to .Cols - 1
.Col = j
RowContents(j) = .Text
Next j

'put the values in a database
sSQL = "UPDATE YourTable SET Field1 = '" & RowContents(1) & "' ..."
...

Next i
End With


Somebody please, should tell me how to write to the recordset fields?

Thanks & Regards
__________________
Manny
Reply With Quote
  #2  
Old 06-22-2003, 09:00 AM
mannyso mannyso is offline
Centurion
 
Join Date: Oct 2002
Location: Canada
Posts: 171
Default

I would like to know how can I set up more fields to this sentence?


sSQL = "UPDATE YourTable SET Field1 = '" & RowContents(1) & "' ..."
__________________
Manny
Reply With Quote
  #3  
Old 06-22-2003, 09:54 AM
VBBrazil VBBrazil is offline
Banned
 
Join Date: Mar 2003
Posts: 555
Default

Exactly like it is:

sSQL = "UPDATE YourTable SET Field1 = '" & RowContents(1) & "'" & Field2 = "'" & RowContents(2) & "'" ... and so on

Try to learn some SQL. You won't go so far with that if you don't.
SQL is extremely easy. Basically you must to learn four commands:

SELECT
INSERT INTO
UPDATE
DELETE

... and a half-dozen more details. Spend sometime and take a look in:

www.w3schools.com/sql/

Hope it helps.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
General Design Question khowell General 4 06-08-2002 05:36 PM
General question for MATH majors... BillSoo General 11 02-22-2002 11:50 AM
General programming language question rog1111 General 6 08-01-2001 07:48 AM
General question about Off-site VB programming rog1111 General 8 06-22-2001 05:44 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->