I.T. Discussion Community!
-Collapse +Expand
VB Classic
Search VB Classic Group:

Advanced
-Collapse +Expand VB Classic Store

Prestwood eMagazine

August Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyVisual Basic Classic BoardVB Classic Database Tasks Topic   Print This     

how to write script (correct my script) for MSFlex

how to write script (correct my script) for MSFlex in VB Classic Database Tasks topic (part of our Visual Basic Classic group).

Quick Search: (correct   script)   how write   how write script   (correct my   script) MSFlex  
gilgal
-- USA
How do I make the script run through the database and write down the records of rs("book_title"),rs("chapter"),rs("verse"),rs("text_data") in a MSFlexGrid?

Private Sub MSFlexGrid1_Click()
'Private Sub Form_Load()
'the format string just lets you define a format for how
'your flexgrid will appear
MSFlexGrid1.FormatString = "Book |" & _
"Chapter |" & _
"Verse |" & _
"Text"

Dim connectionString As String
Dim query As String
Dim cn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
Dim Text1

'Text1 = Request("Text1")

'connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\kjv.mdb;User Id=admin;Password=;"
'query = "SELECT * from bible"
''query = "SELECT * from bible WHERE text_data LIKE %" & Text1.Text & "%"


'make sure the search path to the db is always in the right spot
Data1.DatabaseName = App.Path & "\kjv.mdb"

'set up the recordsource for the datasource and flexgrid control
'in this case, it's just a raw SQL query, simple simple.
Data1.RecordSource = "select * from bible order by id"


cn.connectionString = connectionString
'cn.Open
'cmd.ActiveConnection = cn
cmd.CommandText = query


'Set rs = cmd.Execute


'While rs.EOF <> True
'MsgBox (rs("book_title") & " " & rs("chapter") & ":" & rs("verse") & " " & rs("text_data"))
'rs.MoveNext

'Wend
'Do Until rs.EOF <> True
'list1.AddItem (rs("book_title") & " " & rs("chapter") & ":" & rs("verse") & " " & rs("text_data"))
'rs.MoveNext
'Loop
'Do
'If MsgBox(rs("book_title") & " " & _
' rs("chapter") & ":" & _
' rs("verse") & " " & _
' rs("text_data"), vbOKCancel) = vbCancel Then Exit Do
'rs.MoveNext
'Loop Until rs.EOF

'rs.Close
'cn.Close
End Sub
 Posted 14 years ago (Thread Starter)
Comment Quote
About gilgal -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread but email is NOT VERIFIED.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #11483, 1 replies
Thread Started 6/9/2006 5:38:00 PM
View Counter=3157
Last Reply Posted 6/19/2007 10:13:11 PM)
Location=-- USA 
Joined=14 years ago   MB Posts=1  
Most Recent Post
Moderator
Mike Prestwood
Prestwood IT
Prestwood IT office in Citrus Heights, CA
Instead of doing rs("FieldNameHere"), you should do rs.Fields("FieldNameHere"). I actually prefer specifying the .value property on the end too.

--
Mike Prestwood
Prestwood IT Solutions

 Posted 13 years ago
Comment Quote
About Mike Prestwood -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Mike Prestwood

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Web Presence
Facebook, Prestwood IT Facebook page -- fan page. (Visit Me)
Twitter, Follow Prestwood IT on Twitter. (Visit Me)
LinkedIn, Prestwood IT company page on LinkedIn. (Visit Me)
YouTube, Prestwood IT YouTube Channel (Visit My Channel)
Website, My drum website where I sell my drum books. (http://www.play-drums.com)

Post ID #11901 (Level 1.1)  Reply to 11483
Thread Started 6/19/2007 10:13:11 PM
View Counter=2
Location=Prestwood IT office in Citrus Heights, CA 
Joined=20 years ago   MB Posts=1410   KB Posts=1805   KB Comments=69   BLOG, Topics=4  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1124A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #11483 Counter
3157
Since 4/2/2008

Follow PrestwoodBoards on: 


©1995-2020 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech