04-14-2004, 11:40 AM
1) does any one know how to make queries in vb6 ?
using the shortcut from access SQL view
2) how whould you make a report aswell using vb6 ?
04-14-2004, 04:49 PM
i guess no one can elp me today :(
04-14-2004, 05:44 PM
1) not quite clear what you mean by "using the shortcut from access SQL view"
For the rest, an sql string can be executed from within VB6 by:
-opening a recordset
-executing an sql string against a command or connection objects
2) you have an inbuilt DataReport which you can add to your project
(for more sofisticated reports you might want to overweigh working with third party
04-15-2004, 04:24 AM
wot i menat by shortcut is someone told me that you make the query in access and then go to SQL view and that code you use in vb
i am new on vb an havnt done someting like this before so a simple code to get me started would elp if any one can ... thanks
yh also abt the report how would you generate it from the query ?
once agian a simple code to get me started would help
04-15-2004, 12:01 PM
hope you understand wot i am trying to say
04-15-2004, 12:07 PM
The shortcut you are referring to is something I use to do when I first starting using VBA & VB also. It works kinda like this....
1. First make sure you query works
2. Within the query desing, goto the SQL view, copy & paste all the text
3. In VB, start a line with something like sSQL = "
4. Then paste the query
5. Goto the end of the line & hit spacebar & then the delete key until the next line moves up to your cursor. Tip: to quickly remove a large gap of spaces, press Ctrl+Del
6. Continue until you have the entire query on one line
Once you get good at this, you'll quickly learn that it is ok to leave the pasted query on separate lines and simply terminate each line, execpt the last one, with: " & _
then starting the next line with a quote: "
Anyway it works pretty well. Play with it.
04-15-2004, 12:11 PM
ok thanks i will try that i will let you know if i get any problems thanks agian