473,390 Members | 1,216 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Coding not working in adodc control : v.b 6.0

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,Rate,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,Rate,Qty,Gross from Pinvoice where InvNo=& txtTest.Text"
Adodc1.RecordSource = 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 2368
debasisdas
8,127 Expert 4TB
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
Thanx Debidas i used that query which u sent but still i,m facing the same error , is there any solution plzzzzzzzzzzzzzzzzzzzzzzzz

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 Expert 4TB
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
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"select sum(Gross)as Total from Pinvoice where InvNo="&"'"&txtInvNo.Text&"'"
Adodc1.RecordSource = sqlstring
Adodc1.Refresh
but i doesn,t show me the Total
Apr 16 '08 #5
debasisdas
8,127 Expert 4TB
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
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
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...
0
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...
4
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...
4
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
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...
2
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...
9
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...
6
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....
1
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...

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.