473,789 Members | 2,263 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Coding not working in adodc control : v.b 6.0

31 New Member
Hi all,

Can anyone tell me how to get a record for particular field, in my sql i,v Pinvoice table following fields

InvNo int ItemNo int Descrption varchar(20) Price float Qty Gross float
1001 090 Fan 30 5 150
1001 080 Table 45 2 90
1002 012 Chair 90 3 270
1002 001 ToolBox 120 1 120

now t want to see the particular invNo details in datagrid when i type the particular invNo(for example InvNo =1001) in a textbox so what should i do to get the result.
i tried this ways but no result it showed me the error

1. in a Adodc control Recordsource command type AdcmdText i added the following code select ItemNo,Descrp,R ate,Qty,Gross from Pinvoice where InvNo=&

it showed me error msg Incorrect syntex near&" as well page loading & close

so i tried to give the datasource at run time, in a button click event i added this query

sqlstring
sqlstring = "select ItemNo,Descrp,R ate,Qty,Gross from Pinvoice where InvNo=& txtTest.Text"
Adodc1.RecordSo urce = sqlstring

it also showed me error msg

1. "Microsoft[ODBC Driver manager]datasource name not found" so i droped it.
2."Incorrect syntex near&"
3.Method 'Refresh' of object 1Adodc failed"

plz help me to solve this problem
Apr 16 '08 #1
6 2408
debasisdas
8,127 Recognized Expert Expert
Try to use this
Expand|Select|Wrap|Line Numbers
  1. sqlstring = "select ItemNo,Descrp,Rate,Qty,Gross from Pinvoice where InvNo=" & "'" & txtTest.Text & "'" 
Apr 16 '08 #2
hussainiyad
31 New Member
Thanx Debidas i used that query which u sent but still i,m facing the same error , is there any solution plzzzzzzzzzzzzz zzzzzzzzzzz

and also tell me how to set the total in datareport and datagrid for examples i,v some regards in datagrid and i need the grand total in a textbox in my form

i created a view create view[Total ]as select sum(Gross)as total from Pinvoice

but it showed me the all Gross sum, if i need a particular Supplier how can i do it

in sql we can give like that "select sum(Gross)as total from Pinvoice where InvNo=1001"
but in form how can we do it plz i need ur suggestion
Apr 16 '08 #3
debasisdas
8,127 Recognized Expert Expert
in sql we can give like that "select sum(Gross)as total from Pinvoice where InvNo=1001"
what is the problem if you are using the SQL and pass the value at run time ?
Apr 16 '08 #4
hussainiyad
31 New Member
Dear Debasis

Actually i need the total for particular InvNo so i tried many ways, in sql we can simply use this query "select sum(Gross)as Total from Pinvoice where InvNo=1001" but in my form when i retrive the datas from sql how i make the total thats my question is ? , shall i use the same query in button event

string sql
sqlstring"selec t sum(Gross)as Total from Pinvoice where InvNo="&"'"&txt InvNo.Text&"'"
Adodc1.RecordSo urce = sqlstring
Adodc1.Refresh
but i doesn,t show me the Total
Apr 16 '08 #5
debasisdas
8,127 Recognized Expert Expert
You can use two separate controls one for the record and the second for the total.

If using ADODB then can open 2 separate recordset for the purpose.
Apr 16 '08 #6
er irfan
1 New Member
You have to choose good driver provider. so it may make strong binding with all defined control.
Jun 22 '11 #7

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

Similar topics

1
3738
by: News Central | last post by:
Hi All!, I have a problem refreshing data on the Datagrid control. I execute sql statement directly using the ADODC control and try to make it updated onto the Datagrid control, however, the Datagrid control is not updated with new data... here is the flagment of codes: sql = "update MyTable set Col1='test' where Col1='nodata'" adoMain.Recordset.ActiveConnection.Execute sql adoMain.Refresh Set dgdMain.DataSource = adoMain...
0
1150
by: Meher Malakapalli | last post by:
Hi I have an application built in VB6. It uses an adodc control bound to several other controls. After installing the .NET framework, the application's data-bound controls no longer display the data from the recordset contained by the adodc control. Has anyone run into this problem? Thanks M
4
5983
by: Raoul Watson | last post by:
I have a form with an AdoDc control associated to a datagrid. The AdoDC uses a "ConnectionString" such as "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=..." this is where the problem begins. The data source will not be known until the user selects the database. What is really weird is that if the source is not placed during design time, during run time the form upon loading will generate an error ("Failed to
4
1965
by: nkechifesie | last post by:
I have an adodc control that is build with several tables using the select command. I need to search for a record on the adodc, is it possibles? If yes, how?
4
2576
by: saima khushbakht | last post by:
hi i need coding for find button using adodc control.the search should be by name.if we enter the name of employee then search button should search name from data base either it exists in batabase as first name,middle name, or as last name.the list should display.then if we click particular name from the list then data of that particular employee should display.
2
1897
by: SHIBSHIB | last post by:
i prepare a vb project with adodc control where data will be extracted from an access file. to make an .exe file of that project what should be the path in adodc so that the exe file will be executed normally. shibshib
9
3325
by: Neelesh2007 | last post by:
Hi All, I have developed project in VB6.0 with access as backend.I have used ADODC control in VB to retrieve data from access. I have created the Setup file by Package & Deployment. Now when i install the software on other PC whole program works fine but ADODC can not establish connection with database. Then if I install VB6.0 then only ADODC works. Can any body guide me how can i create set-up file so that i can install my software without...
6
7115
by: jaz215 | last post by:
hi! in my program i'm using the find and bookmark function of the adodc control. as the people want me to use a normal data control, when i tried to run it using the same commands i've got an error. is there any other way to do this function through a data control? i'll post on what i've got but i it seems no to work. can anyone help me pls.. Dim counter As Integer counter = 0 adoEmployee.Recordset.MoveFirst Do While...
1
2175
by: hussainiyad | last post by:
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...
0
9657
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10393
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10187
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10132
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9007
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7523
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6753
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4084
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2902
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.