473,473 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Query Problems

Hi

In my application i have a dataSet which has been created by the
designer. I have added the following query to one of the tables;

------------------------------------------------------------------------------------------------------------------------------------------------

INSERT INTO reservationsTbl
(OrderID, CustomerID, Time, PartySize, Date)
VALUES (@OrderID, @CustomerID,@Time,@PartySize,@Date)

------------------------------------------------------------------------------------------------------------------------------------------------

I now have the following code to try and execute this query;

------------------------------------------------------------------------------------------------------------------------------------------------

Dim reservationsAdapter As New
dsTableAdapters.reservationsTblTableAdapter
Try
reservationsAdapter.InsertReservation(10, ID,
TimeTxt.Text, PartySizeTxt.Text, DatePicker.Value)
Catch ex As Exception
MsgBox("Inserting new record failed. " + ex.Message)
End Try

------------------------------------------------------------------------------------------------------------------------------------------------

No error message is shown when the code is executed however the record
is not inserted. Can anyone help?

Thanks in advance!

Dec 3 '06 #1
6 923
The word "Date" is an sql reserved word. The worrd "Time looks a bit
dodgy as well. Change the table name to something else or escape it by
changing the sql query to this....

INSERT INTO reservationsTbl
(OrderID, CustomerID, [Time], PartySize, [Date])
VALUES (@OrderID, @CustomerID,@Time,@PartySize,@Date)
The Grand Master
"When you have reached the top of the mountain
you can look down at everyone else."
>
In my application i have a dataSet which has been created by the
designer. I have added the following query to one of the tables;

------------------------------------------------------------------------------------------------------------------------------------------------

INSERT INTO reservationsTbl
(OrderID, CustomerID, Time, PartySize, Date)
VALUES (@OrderID, @CustomerID,@Time,@PartySize,@Date)

------------------------------------------------------------------------------------------------------------------------------------------------

I now have the following code to try and execute this query;

------------------------------------------------------------------------------------------------------------------------------------------------

Dim reservationsAdapter As New
dsTableAdapters.reservationsTblTableAdapter
Try
reservationsAdapter.InsertReservation(10, ID,
TimeTxt.Text, PartySizeTxt.Text, DatePicker.Value)
Catch ex As Exception
MsgBox("Inserting new record failed. " + ex.Message)
End Try

------------------------------------------------------------------------------------------------------------------------------------------------

No error message is shown when the code is executed however the record
is not inserted. Can anyone help?

Thanks in advance!
Dec 4 '06 #2
"Thanks for your help" would have been nice. Ignorant shit !

jimmy wrote:
Hi

In my application i have a dataSet which has been created by the
designer. I have added the following query to one of the tables;

------------------------------------------------------------------------------------------------------------------------------------------------

INSERT INTO reservationsTbl
(OrderID, CustomerID, Time, PartySize, Date)
VALUES (@OrderID, @CustomerID,@Time,@PartySize,@Date)

------------------------------------------------------------------------------------------------------------------------------------------------

I now have the following code to try and execute this query;

------------------------------------------------------------------------------------------------------------------------------------------------

Dim reservationsAdapter As New
dsTableAdapters.reservationsTblTableAdapter
Try
reservationsAdapter.InsertReservation(10, ID,
TimeTxt.Text, PartySizeTxt.Text, DatePicker.Value)
Catch ex As Exception
MsgBox("Inserting new record failed. " + ex.Message)
End Try

------------------------------------------------------------------------------------------------------------------------------------------------

No error message is shown when the code is executed however the record
is not inserted. Can anyone help?

Thanks in advance!
Dec 4 '06 #3
I'm sorry but i have only just checked the thread! Thanks anyway

Dec 4 '06 #4
IT WORKS! Thanks for that... it would have taken me ages to figure out
otherwise

Dec 4 '06 #5
He did thank you, you illiterate putz! Read his message.

I am impressed that you actually help someone. (by the way, you don't
need to thank me for that nice comment)

Master Programmer wrote:
"Thanks for your help" would have been nice. Ignorant shit !

jimmy wrote:
Hi

In my application i have a dataSet which has been created by the
designer. I have added the following query to one of the tables;

------------------------------------------------------------------------------------------------------------------------------------------------

INSERT INTO reservationsTbl
(OrderID, CustomerID, Time, PartySize, Date)
VALUES (@OrderID, @CustomerID,@Time,@PartySize,@Date)

------------------------------------------------------------------------------------------------------------------------------------------------

I now have the following code to try and execute this query;

------------------------------------------------------------------------------------------------------------------------------------------------

Dim reservationsAdapter As New
dsTableAdapters.reservationsTblTableAdapter
Try
reservationsAdapter.InsertReservation(10, ID,
TimeTxt.Text, PartySizeTxt.Text, DatePicker.Value)
Catch ex As Exception
MsgBox("Inserting new record failed. " + ex.Message)
End Try

------------------------------------------------------------------------------------------------------------------------------------------------

No error message is shown when the code is executed however the record
is not inserted. Can anyone help?

Thanks in advance!
Dec 4 '06 #6
thanks

The Grand Master

FishingScout wrote:
He did thank you, you illiterate putz! Read his message.

I am impressed that you actually help someone. (by the way, you don't
need to thank me for that nice comment)

Master Programmer wrote:
"Thanks for your help" would have been nice. Ignorant shit !

jimmy wrote:
Hi
>
In my application i have a dataSet which has been created by the
designer. I have added the following query to one of the tables;
>
------------------------------------------------------------------------------------------------------------------------------------------------
>
INSERT INTO reservationsTbl
(OrderID, CustomerID, Time, PartySize, Date)
VALUES (@OrderID, @CustomerID,@Time,@PartySize,@Date)
>
------------------------------------------------------------------------------------------------------------------------------------------------
>
I now have the following code to try and execute this query;
>
------------------------------------------------------------------------------------------------------------------------------------------------
>
Dim reservationsAdapter As New
dsTableAdapters.reservationsTblTableAdapter
Try
reservationsAdapter.InsertReservation(10, ID,
TimeTxt.Text, PartySizeTxt.Text, DatePicker.Value)
Catch ex As Exception
MsgBox("Inserting new record failed. " + ex.Message)
End Try
>
------------------------------------------------------------------------------------------------------------------------------------------------
>
No error message is shown when the code is executed however the record
is not inserted. Can anyone help?
>
Thanks in advance!
Dec 4 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: carverk | last post by:
Hello All I'm in the middle of moving a MS Access DB to a MySql backend. I have figured out about 90% of the problems I have faced, execpt for this one. I have 3 Queries, which pull records...
0
by: Mike N. | last post by:
Hello to all: First let me apologize for the length of this question, I've made an attempt to include as much information as is needed to help with the question. I am having problems putting...
1
by: Jeff Blee | last post by:
I hope someone can help me get this graph outputing in proper order. After help from Tom, I got a graph to display output from the previous 12 months and include the average of that output all in...
5
by: sulemanzia | last post by:
hi. i am working first time with query and reports. i have created a database. i have reports and query. i have a button in my form by the name of (View reports) if a user clicks on that button it...
3
by: faceman28208 | last post by:
Over the past few years I have consulted on six large projects that all independently arrived at the same moronic design desision: The use of SQL query classes. No, I don't mean a class...
22
by: Stan | last post by:
I am working with Access 2003 on a computer running XP. I am new at using Access. I have a Db with a date field stored as mm/dd/yyyy. I need a Query that will prompt for the month, ie. 6 for...
6
by: gerbski | last post by:
Hi all, I am relatively new to ADO, but up to now I got things working the way I wanted. But now I've run into somethng really annoying. I am working in MS Access. I am using an Access...
2
by: webhead74 | last post by:
Hi, I'm having intermittent problems with queries from my php script to a postgresql database. I have a form where I can enter a search query - for instance a last name. This leads to a...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
9
by: Bob Darlington | last post by:
The following query opens slowly the first time it is opened (6-7 seconds), but then is less than one second for the next random number of openings before slowing (6-7 seconds) again. SELECT...
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...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
1
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...
0
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...
0
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 ...

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.