472,143 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

Problem in sql connection through adodc control in v.b 6.0

Dear all,
i,m new to v.b and i tried to connect to sqlserver through adodc in a datagrid or datalist , but there was no result in my form, can any one tell me what's the reason and i done every thing to connect with the sql
step 1:Right click the adodc control declared the provider,database,pwd
step2.: In choose Record source i declaled the commad type as "cmd table" and as well the table name
step 3 : Draged a data grid and declared the datasouce as " adodc1"

but still i couldn' t see the result
(I also tried to connect the Ms.Access but it also not coming)

plz advice me the above solution
Thanks in advance
Apr 1 '08 #1
1 1976
Try this for your datagrid adodc problem

Step 1: Draw your adodc1 and data grid on your form

step 2: on your windows start menu, go to setting and then control panel where we are going to create a connection that you are going to be using
Follow the following root: Control Panel.....Performance and Maintenance....Administrative Tools......DataSources(ODBC). Then under UserDSN tab select add on right side of the box. In the Create New data source dialog box, scroll down to select SQL server. Click Finish then Give it a name, description(Can be of tha same name eg MySQLConn) and select the server where your sql database resides. Go next and change the default database to your databaseName and finish

step 3: Right click on your Adodc1 and go to adodc properties. Under General Tab choose Use ODBC data souce name and drop down the combobox to select the data source you created earlier in your windows control panel. Under the Record source tab cmdtype = 1-Adcmdtext and under cmdText=select * from [Table Name] and the apply and OK.

Step 4: datagrid properties- datasource=adodc1

run your program
Apr 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Raoul Watson | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.