SQL in DataEnvironment....????

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2007
Posts: 9
Reputation: rtm_e is an unknown quantity at this point 
Solved Threads: 0
rtm_e rtm_e is offline Offline
Newbie Poster

SQL in DataEnvironment....????

 
0
  #1
Nov 3rd, 2007
Hi, i am using Data Environment to connect VB with my Access Database.

Can i use SQL statement in my script (manualy)..??
Please tell me how to do it

Thanks

RE
-Denpasar-
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,099
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 128
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: SQL in DataEnvironment....????

 
0
  #2
Nov 4th, 2007
after creating the connection object establish the connection to the database. Right click on connection and add a command object .Right click on the command object and select sqlstatment in the general tab in properties . add the sql statment that you want.

Hope that solves your problem.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 9
Reputation: rtm_e is an unknown quantity at this point 
Solved Threads: 0
rtm_e rtm_e is offline Offline
Newbie Poster

Re: SQL in DataEnvironment....????

 
0
  #3
Nov 4th, 2007
Originally Posted by debasisdas View Post
after creating the connection object establish the connection to the database. Right click on connection and add a command object .Right click on the command object and select sqlstatment in the general tab in properties . add the sql statment that you want.

Hope that solves your problem.
Thanks, but thats not what i want
I'm trying to use SQL statement in my scripting, not by creating an object
something like

DIM strSQL as STRING
strSQL = "SELECT NamPeg FROM ...."
.....
.....


So i make the SQL statement in my project not by creating command object
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 568
Reputation: ryan_vietnow is an unknown quantity at this point 
Solved Threads: 71
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: SQL in DataEnvironment....????

 
0
  #4
Nov 5th, 2007
for example:

Adodc1.Recordsource="Select * from Table1";
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 9
Reputation: rtm_e is an unknown quantity at this point 
Solved Threads: 0
rtm_e rtm_e is offline Offline
Newbie Poster

Re: SQL in DataEnvironment....????

 
0
  #5
Nov 5th, 2007
Originally Posted by ryan_vietnow View Post
for example:

Adodc1.Recordsource="Select * from Table1";
i've allready try that, but it doesnt work
i make connection using Data environment object, not by script...

but thanks anyway, i'll try again, maybe there is something i miss
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,099
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 128
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: SQL in DataEnvironment....????

 
0
  #6
Nov 5th, 2007
What bout trying like this.
  1. Connection1.ConnectionString = "......connection string here.........."
  2. sql = ".........sql query here.........."
  3. Connection1.BeginTrans
  4. Connection1.Execute sql
  5. Connection1.CommitTrans
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 160
Reputation: kb.net is an unknown quantity at this point 
Solved Threads: 26
kb.net's Avatar
kb.net kb.net is offline Offline
Junior Poster

Re: SQL in DataEnvironment....????

 
0
  #7
Nov 6th, 2007
Hi,

I have created you a small example of recprdset coding and attached it. Check if it is what you need. If further assistance is needed please reply.
Attached Files
File Type: zip Example_RS.zip (1.8 KB, 21 views)
It is never about the number of languages you know, you either have the logic of programming or you don't ...

Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC