473,386 Members | 1,864 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,386 software developers and data experts.

I want SQL query to retrieve data

Hello.
I am making a VB application with Access database in backend. I can feed data from datagrid control to database. But I have a problem while retrieving data.
The code used is
Expand|Select|Wrap|Line Numbers
  1.   With comSupplier
  2.  .ActiveConnection = conSupplier
  3.  .CommandText = "INSERT INTO temp1 SELECT   Sr_No,Bill_Date,Vend_code,Round FROM PRHD0801 WHERE Bill_Date =" & strName
  4.  .Execute
  5. End With
While debugging I get value of strName but problem while executing.
Please give me any idea.
Dec 22 '07 #1
3 1397
debasisdas
8,127 Expert 4TB
If you are trying to retrieve records, why are you using the INSERT command?
Dec 22 '07 #2
If you are trying to retrieve records, why are you using the INSERT command?
I have a table with details record. I am using blank temp for filling data ,send the data from temp to detail & delete data from temp.When I am trying to retrive data I want to transfer data from detail to temp which satifies the condition
After that I can see the data from temp.The problem is in inserting.
Dec 22 '07 #3
Killer42
8,435 Expert 8TB
Well I must say, your WHERE clause looks very questionable. Are you sure that's the correct field (Bill_Date) and variable (strName)?

And regardless of the answer to the above, have you considered the issue of delimiters? Unless it's a numeric field it will need some sort of delimiters around the value. Are they already present in variable strName?
Dec 29 '07 #4

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

Similar topics

6
by: Fred | last post by:
Hi ! Can some one give me a little step by step to put me onthe right way.. I'd like to use PHP with Postresql. I need to make many whois query on the domain names that we own, to store the...
0
by: wellnesseducation | last post by:
I have enabled session stating on an application I have written by modifying the web.config to write to a SQL database, after I ran the state script with the query analyzer provided by the .NET...
4
by: Bernard Dhooghe | last post by:
To retrieve data from a query where multiple rows can be returned, a cursor can be used. Different programming interface exist for cursors: embedded SQL, CLI, SQL PL, SQLJ, JDBC. I we look at...
8
by: Jim in Arizona | last post by:
I've been using an example out of a book to be able to edit the rows in a database. I am getting the following error: ========================================================...
10
by: Raj | last post by:
I have an MDC index on Big_A.Dt column. The following query always goes for a table scan. SELECT Key, Cd, Dt, SUM(Big_A ) FROM ( SELECT Big_A.Key , small_3.Cd,
4
by: Hemant Shah | last post by:
Folks, I am having problem with an application that uses static SQL, the application basically browses through the table given start and end key most of the time it is processed from begining to...
10
by: Gerhard | last post by:
Hi, all I run into the same problem on Access 2000 and 2003. Hopefully someone can replicate it – or not. 1. Create an unbound form – call it Form1. 2. Insert two unbound text boxes –...
3
by: sheenaa | last post by:
Hello friends, I m using ASP.NET with C# 2005 and SQL SERVER 2005 for the ASP.Net Website. I m using sqldatasource to connect and retrieve the data from database and then it displays the data...
3
by: Oenone | last post by:
I have a project that creates a SqlDataAdapter and uses its Fill method to fill a DataTable with data from a user-provided query. From there I can obviously access details about the rows and...
1
by: Vinod Sadanandan | last post by:
A Roadmap To Query Tuning ============================ For each SQL statement, there are different approaches that could be used to retrieve the required data. Optimization is the process of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...
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...

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.