insert into syntax error

Hi All,

I use following query to insert recs in a table:

sSQL = "INSERT INTO SID_Master_Archief IN " & sys.sDBMap &
"archief.mdb" & _
            " SELECT ArchiefTmp.* FROM ArchiefTmp"

rsArchiefX.Execute (sSQL)

Now I get an error saying there is a syntax error in the sting.

MArco

0
Co
7/6/2007 2:17:09 PM
access 16762 articles. 3 followers. Follow

5 Replies
512 Views

Similar Articles

[PageSpeed] 41

What exactly does sSQL contain? Try using Debug.Print sSQL, then looking in 
the Immediate Window (Ctrl-G) to see.

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Co" <vonclausowitz@gmail.com> wrote in message 
news:1183731429.412224.289520@w3g2000hsg.googlegroups.com...
> Hi All,
>
> I use following query to insert recs in a table:
>
> sSQL = "INSERT INTO SID_Master_Archief IN " & sys.sDBMap &
> "archief.mdb" & _
>            " SELECT ArchiefTmp.* FROM ArchiefTmp"
>
> rsArchiefX.Execute (sSQL)
>
> Now I get an error saying there is a syntax error in the sting.
>
> MArco
> 


0
Douglas
7/6/2007 2:37:05 PM
it might just be a missing space before archief.mdb: " archief.mdb".

HTH,

"Co" <vonclausowitz@gmail.com> wrote in message 
news:1183731429.412224.289520@w3g2000hsg.googlegroups.com...
> Hi All,
>
> I use following query to insert recs in a table:
>
> sSQL = "INSERT INTO SID_Master_Archief IN " & sys.sDBMap &
> "archief.mdb" & _
>            " SELECT ArchiefTmp.* FROM ArchiefTmp"
>
> rsArchiefX.Execute (sSQL)
>
> Now I get an error saying there is a syntax error in the sting.
>
> MArco
> 


0
George
7/6/2007 2:39:40 PM
On 6 jul, 16:39, "George Nicholson" <GeorgeNJ...@Junkmsn.com> wrote:
> it might just be a missing space before archief.mdb: " archief.mdb".
>
> HTH,
>
> "Co" <vonclausow...@gmail.com> wrote in message
>
> news:1183731429.412224.289520@w3g2000hsg.googlegroups.com...
>
> > Hi All,
>
> > I use following query to insert recs in a table:
>
> > sSQL = "INSERT INTO SID_Master_Archief IN " & sys.sDBMap &
> > "archief.mdb" & _
> >            " SELECT ArchiefTmp.* FROM ArchiefTmp"
>
> > rsArchiefX.Execute (sSQL)
>
> > Now I get an error saying there is a syntax error in the sting.
>
> > MArco

This is what I get from the Debug window:
INSERT INTO SID_Master_Archief IN 'D:\Archief.mdb' SELECT ArchiefTmp.*
FROM ArchiefTmp

Looks fine to me.

Marco

0
Co
7/6/2007 3:20:14 PM
> INSERT INTO SID_Master_Archief IN 'D:\Archief.mdb' SELECT ArchiefTmp.*
> FROM ArchiefTmp

What type of object is rsArchiefX ?

Do the fields in SID_Master_Archief match up with the fields in
ArchiefTmp?

What happens when you run this query from the query builder (instead
of from code)?

Are you sure that is the correct syntax for modifying a table in
another database. I thought it was:

INSERT INTO [D:\Archief.mdb].SID_Master_Archief
SELECT *
FROM ArchiefTmp

but that might just be for the query builder.

-Kris

0
krissco
7/6/2007 4:20:47 PM
On Jul 6, 3:17 pm, Co <vonclausow...@gmail.com> wrote:
> Hi All,
>
> I use following query to insert recs in a table:
>
> sSQL = "INSERT INTO SID_Master_Archief IN " & sys.sDBMap &
> "archief.mdb" & _
>             " SELECT ArchiefTmp.* FROM ArchiefTmp"
>
> rsArchiefX.Execute (sSQL)
>
> Now I get an error saying there is a syntax error in the sting.
>
> MArco

I made a quick check and my SQL became:
INSERT INTO Contacts ( FirstName, LastName ) IN 'D:\Documents and
Settings\Hans Kristian\My Documents\test.mdb'
SELECT MyContactTbl.FirstName, MyContactTbl.LastName
FROM MyContactTbl;

Sincerely
Hans Kristian Eide

0
IUnderstandSomething
7/6/2007 10:18:03 PM
Reply:

Similar Artilces:

Error message loop in M04
Money 2004 came loaded on my new HP laptop so I have tried to use it, but have a problem. 1. I convert my Quicken 2002 files to Money 2004. That works Ok. I can update them manually no problem. I can save and back them up, and close the program. 2. But if I once attempt to update stock quotes, The whole works stops. Microsoft wants me to send them an error message, and restart Money. This becomes an endless loop, of error message and re-starts. 3. I have removed and re-installed Money, and re- converted the Quicken file, but now the error loop starts even before I go online. I have...

5102 error
Time: 5/3/2010 2:04:17 PM Error in Mail Error with Send/Receive. Look for a log in the Sync Issues folder. Time: 5/3/2010 2:05:37 PM Error in Mail The server reported a temporary error. Error: 5102. Server. Maximum request length exceeded.. -- Hoe do I fix this error? Thanks a Lot, Henery Ray Ray "Henery Ray Ray" <HeneryRayRay@discussions.microsoft.com> wrote in message news:0C0483B8-AE15-4B31-AAE8-BB12EEE714F2@microsoft.com... > Time: 5/3/2010 2:04:17 PM > Error in Mail > Error with Send/Receive. > Look for a log in the Sync Issues folder. ...

Error Message #94
We run Outlook Express on several machines. In the case of two machines just updated with XP SP-2, and running the latest and greatest version of Outlook Express, we get an error message, "Either there is no default mail client or the current mail client cannot fulfill the messaging request.". Outlook has never been activated on these machines, and Outlook Express is definitely set as the default mail client. A search of the web reveals only instructions for deleting a key from the registry for Outlook and to run Detect and Repair, but we are not running Outlook, and OE does not ...

usb rndis compile error
Hi We r developing the usb rndis support in boot loader. So, i am integrating my device specific usb function driver with rndiskitl (which is get from mainstone III). when i comile this get, i got the following error msg. error LNK2001: unresoved external symbol __C_specific_handler. Could you anyone give idea? thanks in advance. with, D. To be technical, this is a linker error that you get when you link. So the obvious quesion is what are you linking, and what libraries are you linking with? I suspect that this is from linking your bootloader, not when linking ...

Authentication Error?
All as a sudden we get this error on and off on a new CRM 3.0 install on a SBS 2003 box w/ ISA 2004 when trying: http://server:5555 Authentication Error Microsoft CRM could not log you on to the system Make sure your user record is enabled and that you have been assigned at least one security role < and more text> Started happening overnight. We are not aware that we changed anything. Any ideas? Per... Our users (Outlook) get this periodically. We found it is because CRM cannot contact the SRS server. Since these are on the same physical box, we have to restart it. We ar...

Error converting lead to contact and account
Hi All, I have a problem to convert a lead to Account/Contact at the same time. - It works fine if I convert Lead->Opportunity then reactivate the lead from Oppt and convert the lead to Account. - It won't work if I convert a Lead->Contact, then reactivate the lead from Contact to convert to Oppt, then reactivate the lead from Oppt and convert the lead to Account. (If I have the contact record, it will not allow me to create an account from converting). The error shown below: Stack Trace: [COMException (0x80040237): Exception from HRESULT: 0x80040237.] Microsoft.Crm.Plat...

An unexpected error occurred.(CRM Email)
Need some help, I'm running MS Small Biz 2003 server and CRM 1.2 on the same box. I have been stumped by this error: COM Proxy: Error Loading File : File may not exist, damaged, or ect. The above is from teh Debug Info. Error Description: An unexpected error occurred. Error Details: An error occurred attempting to dispatch the email : Could not connect to host Error Number: 0x80040216 Source File: D:\crm\Build\3297\src\platform\include\proxy\proxyutil.h Line Number: 47 Date: 12-17-2004 Time: 10:02:11 AM Type: Platform Error (2) Server: companyweb Query String: /Activit...

Error Code 8024000E Windows Update Not Functional!
A couple of days ago my PC stopped being able to even check for or get updates. I believe that something that was installed on the update of 11/13 caused this issue because my computer suddenly has 3 problems it has never had before. Here are the lines from the log file where the process bombs out: 2009-11-14 12:34:19:709 1356 20f4 Setup WARNING: SelfUpdate failed to load WuPackages.xml file, error = 0x8024000E 2009-11-14 12:34:19:709 1356 20f4 Setup WARNING: SelfUpdate check failed to download package information, error = 0x8024000E 2009-11-14 12:34:19:709 1356 20f4 Setup FAT...

Font Limit error message in Excel XP
I am currently using a spreadsheet and drawing a large number of graphs. I keep getting an error message "No more new fonts may be applied in this workbook". I am not applying new fonts; I am merely changing the titles (and units)on a number of similar graphs. Is there a way of increasing the number of fonts that excel will let me have? This is getting to be a very frustrating problem. Thanking you in anticipation. Maybe one of these... XL2000: Error Copying Worksheets Containing Charts http://support.microsoft.com/default.aspx?scid=KB;en-us;q215573 and XL97: How to Turn ...

receiving error "id" is not an index in this table error 3800.
When trying to access a table in a exsisting database, I get a error box stating "id is not an index in this table. Accessing the help button for this error. The statement of Error 3800 is displayed. Does anyone know how to clear this up? Is it a failure with Access or the state of the database? EveryCreatureCounts wrote: >When trying to access a table in a exsisting database, I get a error box >stating "id is not an index in this table. Accessing the help button for >this error. The statement of Error 3800 is displayed. Does anyone know how to >clear thi...

error with formula
Hi guys here is the issue. Under column A, which is titled serial number, I have listed the formula =IF(ISNUMBER(B28)=TRUE,A27+1,""). What this does is that it detects if there is a date in column B and then inputs a serial number that is one more than the previous one. If not the cell in column A is just left blank if no date is detected. Under column D, entitled Receipt number, I have inputed the formula =IF(MOD(A27,8)=0,"","NA"). What this does is it detects the serial number in column A and checks if it is a muliple of 8. If it is the cell in column D ...

Outlook Sync Error!!!
Hi All, We are having trouble going offline with CRM Server by using the Outlook Client. System objects such as “Notes”, “Activities”, "Contacts", etc. are download without error but once the system starts to pull Opportunities I get the following error on my local computer. -------------------------------------------------------------------------------------------------- An error occurred during Offline Synchronization. Try going offline again, or restart Microsoft Outlook. saInsert failed for entity 'Opportunity', batchRows=99 with exception System.Data.SqlClient.Sq...

Shared Excel File
Shared Excel files on the department directory do not seem to close properly. The subsequent user gets a message when they attempt to open a file that the last person to use it is still in it, even though the former user doesn't have it open. Bill ...

Proving mail relay error is not the server
I have a bad situation in which the company that manages our DNS records had a server crash over the weekend. Our MX record got messed up. Based on my troubleshooting this company does not understand what they are doing. It's been 3 days, and I still am getting two different responses when doing a nslookup against our domain for the mx. What if anything can I do to prove my point? The company does not understand and they don't know who to blame. ...

Socket Error/outlook express
I know this is for outlook however I was unable to find a group on outlook express. We were able to remove 3 viruses "Downloader Turown B, C, and D and now we get this error please help not much hair left to pull out! The connection to the server has failed, Account: 'pop.netzero.com'. Server: 'smtp.netzero.com', protocol: SMTP, Port:25, Secure(SSL): No, Socket Error: 10061, Error Number: 0x800CCCDE The connection to the server has failed. Account:: 'pop.slkc.qwest.net(1)', Server:'pop.slkc.qwest.net', Protocol:SMTP, Port 25, Secure (SSL): No, Soc...

Error message 35100 doesn't exist
Hi there, We have just upgraded our GP 8 sp5 installation to GP 9. When we open GP Utilities to start the DB upgrade, we get an error message which says: "Error message 35100 doesn't exist" and then another message which says: "Error upgrading table: DB Upgrade". Any ideas? We have tried removing packages from the DynUtils file. Thanks! ...

Writing user friendly error message in Access for specific SQL Server table error
Hello, I have several forms using data stored in SQL Server tables. When a user enters duplicate information, I get the Access error message that says (correctly) "The changes you requested to the table were not successful because they would create duplicate values...etc.". I would like this message to say "The contact information you entered already exists. Please choose this contact from the contact list and add or modify information as needed." I am not using OnError to do this because if there is another problem that causes an error message to occur, I don...

OE downloading error.
I get the following error message when trying to download my email from yahoo into OE. Up until today everything was working correctly now suddenly this occurs. I have not changed anything. Any ideas? An unknown error has occurred. Account: 'Josh Smith', Server: 'pop.mail.yahoo.com.au', Protocol: POP3, Port: 110, Secure(SSL): No, Error Number: 0x800C0133 Try posting this in an Outlook Express news group - this is not one of them. Outlook is a part of Microsoft Office and is what this group supports. Outlook Express is a part of Internet Explorer and has its own news grou...

Run-Time Error '6' Overflow
I'm in need of a suggestion/help with an error I'm getting with my Access 2007 form's calculated control field(s). I'm getting a "Run-time error '6' - Overflow" message when I go to another field and the AfterUpdate() event fires. Most values may contain a 0 initially until inputted or may stay as a zero depending on what pieces of equipment are run. I've set the table structure up and set the field numbers as Long Integers a Here is a sample of my code. Any suggestions would be most appreciated. Private Sub Changes() Me.Rejects_Rough = (Me...

Outlook 2000 Error message
This is a repost. Milly Staples [MVP - Outlook] began to help me but that didn't work. I tried your suggestion and downloaded MDAC 2.8 but was politely informed that either MDAC 2.8 was not compatible with my system or that all modules where already present. Probably due to having Windows AUTO Update enabled. I have also updated to Outlook Sp-3 without any improvement. What does MPR.dll do and does it interact with any other programs. Also my Pocket PC will not Synch with the TASKS list, does that info help or hinder?? Occasionally (about 1 in 20 restarts) Windows gives me the same er...

Win2000 Domain, Adding 2K3 Server, Exchange 2k3 Errors
I have a network that consists of 8 Windows 2000 servers. 6 local servers, and 2 at remote locations. Of the 6 servers I have here, 4 of them are domain controller and 2 are just member servers. The 2 servers most important to this post are my main domain controller that runs DHCP, DNS, and it holds all FSMO roles and is a global catalog server. The other server I'll mention alot is my exchange server that is exchange 2003 running on windows server 2000. By the way, the exchange server is also a global catalog server. What I want to do is insert a new server running server 200...

"Object Required" Error
Hi everyone, I created a macro a few weeks ago and used it a lot immediately afterwards, but I haven't touched it in a while. I have made some other changes to the spreadsheet since then and when I went to use it again just now, I keep getting an error message "Object Required". Nothing has changed in the code and I'm at loss as to what the problem could be. The only thing I can think of is that a new worksheet was added, and the macro uses worksheet indexes... I've fooled around with the code to try and see if this might have been the problem but to no avail. All the ...

insert data into table
Hi There, I'm using following code to insert data into my DB but it doesn't work: try { int tmp = 0; tmp = this.routeTableAdapter1.InsertRoute(Int32.Parse(this.DestNum.Text), this.Destination.Text, Int32.Parse(this.LineNum.Text)); MessageBox.Show("inserted " + tmp.ToString() + " elements into the route table."); MessageBox.Show("Update() returns: " + routeTableAdapter1.Update(myPID_DB_DataSet).ToString()); myPID_DB_DataSet.AcceptChanges();...

Pivot Table Error...Help!
Hi, I have created numerous pivot tables in my workbook. The refres function was working fine. A couple fo days have passed and now when go to refresh the tables i get the attached error. does anyone know how to fix this? thanks +------------------------------------------------------------------- |Filename: pivot.jpg |Download: http://www.excelforum.com/attachment.php?postid=2677 +------------------------------------------------------------------- -- molavi11 ----------------------------------------------------------------------- mo...

put / call option errors
I've entered some put and call transactions in my investment account. I'm finding that they are not showing up in the tax reports (closed positions not present). If I display the closed positions in the account summary, some but not all of the options show up. This can't be correct. Any similar experiences out there? In microsoft.public.money, Wayne wrote: >I've entered some put and call transactions in my investment account. I'm >finding that they are not showing up in the tax reports (closed positions >not present). What program are you using? US Money 2004 ...