|
-
Oct 18th, 2000, 10:35 PM
#1
Thread Starter
Lively Member
im learning vb at the moment
i have 2 command buttons on my form called show and save, a
listview control on my form
i would like to connect to my SQL database called
mydatabase on my server called 'nt009'
my username is sa and there is no password
"select firstname from mytable"
"select surname from mytable"
and display all the firstnames and surnames
in my listview control under two headings
name and surname and be able to edit that data then clcik on my
save button to save that data that i edited in
my listview control????
can this be done??
ive been trying for days but i cannot get it right
please help me!!!!
-
Oct 19th, 2000, 02:19 AM
#2
Lively Member
this would be fairly difficult coding since the listview is not a bound control
why not do this with a DBGrid - It is made to do specifically what you want
-
Oct 19th, 2000, 02:44 AM
#3
Addicted Member
first of all: never leave the password for the 'sa' user blank!!! Give it a password, write it down in a save place, create another administrator user and work with this one.
Then, you can use the 'data environment' for connecting to the sql server database. You can find it under: project -> components. Then the tab 'designers' and 'data environment'.
Now rightclick in the project window, choose 'add' , 'data environment'
Now rightclick on connection1, choose 'microsoft ole db provider for sql server' and fill in the desired fields.
Now you have a connection!
You can create a 'command' and write sql for retrieving data from tables.
You can drag the commands to a form and automatically you have the fields on the form.
hth.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|