Hi, I have an Access database that I am creating a java front end to.
I am trying to insert a record into a table and get a problem whenever
I try to insert into my "Number" column.
Here is my table schema:
Column 1 Name: Number Type: VARCHAR
Column 2 Name: Street Type: VARCHAR
Column 3 Name: Phone Type: VARCHAR
Column 4 Name: Comments Type: LONGCHAR
Column 5 Name: Pets Type: VARCHAR
Column 6 Name: id Type: VARCHAR
Column 7 Name: Phone2 Type: VARCHAR
Column 8 Name: Email Directory Type: BIT
Here is my insert statement that creates the error:
queryString = "INSERT INTO Homes (id,Street,Numb er) VALUES ('5000a',
'Test Bend','5000');" ;
m_statement.exe cuteUpdate(quer yString);
This statement works, however:
INSERT INTO Homes (id,Street,Phon e) VALUES ('5000b', 'Test
Bend','555-555-1234');
Here is the error:
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
statement.
[Ljava.lang.Stac kTraceElement;@ 1a786c3 1 4975
2BaCook wrote: Hi, I have an Access database that I am creating a java front end to. I am trying to insert a record into a table and get a problem whenever I try to insert into my "Number" column.
Here is my table schema: Column 1 Name: Number Type: VARCHAR Column 2 Name: Street Type: VARCHAR Column 3 Name: Phone Type: VARCHAR Column 4 Name: Comments Type: LONGCHAR Column 5 Name: Pets Type: VARCHAR Column 6 Name: id Type: VARCHAR Column 7 Name: Phone2 Type: VARCHAR Column 8 Name: Email Directory Type: BIT
Here is my insert statement that creates the error: queryString = "INSERT INTO Homes (id,Street,Numb er) VALUES ('5000a', 'Test Bend','5000');" ; m_statement.exe cuteUpdate(quer yString);
This statement works, however: INSERT INTO Homes (id,Street,Phon e) VALUES ('5000b', 'Test Bend','555-555-1234');
Here is the error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. [Ljava.lang.Stac kTraceElement;@ 1a786c3
Just guessing.
Phone numbers usually aren't stored as numbers in a table...usually they
are strings. So I can understand why the phone number works if that is
the case. I'm not sure why you want to stuff a string into a number
field unless the field Number, in the table, is a string. What happens
if you remove the single quotes around the number 5000? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Philip Boonzaaier |
last post by:
I want to be able to generate SQL statements that will go through a list of
data, effectively row by row, enquire on the database if this exists in the
selected table- If it exists, then the colums must be UPDATED, if not, they
must be INSERTED.
Logically then, I would like to SELECT * FROM <TABLE>
WHERE ....<Values entered here>, and then IF FOUND
UPDATE <TABLE> SET .... <Values entered here> ELSE
INSERT INTO <TABLE> VALUES <Values...
|
by: robert |
last post by:
been ruminating on the question (mostly in a 390/v7 context) of
whether, and if so when, a row update becomes an insert/delete.
i assume that there is a threshold on the number of columns of
the table, or perhaps bytes, being updated where the engine just
decides, screw it, i'll just make a new one.
surfed this group and google, but couldn't find anything.
the context: we have some java folk who like to parametize/
|
by: MrNobody |
last post by:
What's the easiest way to make an insert using Microsoft.Jet.OLEDB.4.0
OleDbConnection connection to a MS Access data base file?
I'm finding examples out on the net that have like 1,000 line of code to
perform what I would imagine should be a very simple task.
I've mostly done DB code in Java and it would be simply making a
PreparedStatement with the wild cards inside, like:
"insert into MyTable (my_id, my_text) values (?, ?)"
|
by: rn5a |
last post by:
During registration, users are supposed to enter the following
details: First Name, Last Name, EMail, UserName, Password, Confirm
Password, Address, City, State, Country, Zip & Phone Number. I am
using MS-Access 2000 database table for this app. Note that the
datatype of all the fields mentioned above are Text. Apart from the
above columns, there's another column in the DB table named
'RegDateTime' whose datatype is Date/Time which is...
|
by: ak1dnar |
last post by:
There is a Error getting while i am entering records using this jsp file.
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="../Connections/conn.jsp" %>
<%
// *** Edit Operations: declare variables
// set the form action variable
String MM_editAction = request.getRequestURI();
if (request.getQueryString() != null && request.getQueryString().length() > 0) {
| |
by: Subrat Das |
last post by:
Hi,
I have a java application which calls a stored procedure to insert data into a table.Multiple threads of java call the same procedure at the same time. Sometimes it happens that few threads send the same data as parameter to the procedure. In that case i get the error : "Cannot insert duplicate key row in object ...."
The functionality of the proc is - It checks if a given data (Based on Unique key) is present in the table or not. If...
|
by: yeap |
last post by:
Hi All,
I can't insert java variable into ms access database.
I'm using odbc connection to ms access.
Below are my coding.
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// set the connection for database path
String Database_Path = "E:/Segi/Project/Coding/Car_Park_Storage.mdb";
|
by: vijaykumardahiya |
last post by:
Hello Sir,
I have a simple Issue but It is not resolve by me i.e input parameter
are not store in Ms-Access.
I store the input parameter through Standard Action <jsp:useBean>.
jsp:useBean call a property IssueData. this property exist in
SimpleBean which create a connection from DB and insert the data.
At run time servlet and server also show that loggging are saved in DB.
But when I open the table in Access. Its empty.
Ms-Access have...
|
by: oranoos3000 |
last post by:
hi
i have an error with enter record to table in database(mysql)
structure of my table is as follow
- phpMyAdmin SQL Dump
-- version 2.11.6
-- http://www.phpmyadmin.net
--
-- Host: localhost
|
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...
|
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...
| |
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...
|
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,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |