Re: Query an external database...
From: DIOS (sindizzy_at_softhome.net)
Date: 02/17/04
- Next message: Jim Carlock: "Re: Query an external database..."
- Previous message: Kevin Yu [MSFT]: "Re: Creating Temporary Table"
- In reply to: DIOS: "Re: Query an external database..."
- Next in thread: Dirk Goldgar: "Re: Query an external database..."
- Reply: Dirk Goldgar: "Re: Query an external database..."
- Reply: Dave: "Re: Query an external database..."
- Messages sorted by: [ date ] [ thread ]
Date: 17 Feb 2004 11:12:52 -0800
Well, I reviewed the SQL and it looks like so:
sSQL = "INSERT INTO tblEmployees (FullName, Initials) " & _
"SELECT EmpNme, Init " & _
"FROM tblEmployees " & _
"IN '" & sOldDBPath & "';"
CurrentDb.Execute sSQL
When I run this inside my Access VBA code I get the error:
Runtime error 3134
Syntax error in INSERT INTO statement.
There has to be a way of doing this. It seems like a simple query to
me but I just cant get the right syntax down to work properly.
AGP
"DIOS" <sindizzy.pak@softhome.net> wrote in message news:<0iiXb.176439$U%5.838579@attbi_s03>...
> I apologize. The error reported is a synatx error in SQL statement.
> I must have skipped that space after the Init field. let me try that
> and see how it turns out.
>
> AGP
>
> --
>
> **********************************************************************
> Unpak my email address before sending me personal email
> **********************************************************************
>
> "Dirk Goldgar" <dg@NOdataSPAMgnostics.com> wrote in message
> news:esjd$dl8DHA.2524@TK2MSFTNGP11.phx.gbl...
> > "DIOS" <sindizzy@softhome.net> wrote in message
> > news:7d00f3c.0402130810.713699fe@posting.google.com
> > > I think that almost works except that my fields are named differently
> > > so Im trying this and it doesnt seem to work. I can feel im close, i
> > > just have to get the synatax right:
> > >
> > > sSQL = "INSERT INTO tblGroup (FullName, Initials) " & _
> > > "SELECT EmpNme, Init" & _
> > > "FROM tblGroup " & _
> > > "IN '" & sOldDBPath & "';"
> > >
> > > CurrentDb.Execute sSQL
> > >
> > >
> > > Its almost driving me insane. I know this should be a pretty easy
> > > query but i just cant get it to work right. Ive looked at the help and
> > > ive searche don google.
> >
> > You must get in the habit of stating exactly what error message you get,
> > or how the outcome is different from your expectations, instead of
> > simply saying "it doesn't seem to work." In this case, the only thing I
> > see that is still wrong in the statement you posted is that you have no
> > space after the field name "Init". Try this corrected version:
> >
> > sSQL = "INSERT INTO tblGroup (FullName, Initials) " & _
> > "SELECT EmpNme, Init " & _
> > "FROM tblGroup " & _
> > "IN '" & sOldDBPath & "';"
> >
> > and report the result.
> >
> > --
> > Dirk Goldgar, MS Access MVP
> > www.datagnostics.com
> >
> > (please reply to the newsgroup)
> >
> >
- Next message: Jim Carlock: "Re: Query an external database..."
- Previous message: Kevin Yu [MSFT]: "Re: Creating Temporary Table"
- In reply to: DIOS: "Re: Query an external database..."
- Next in thread: Dirk Goldgar: "Re: Query an external database..."
- Reply: Dirk Goldgar: "Re: Query an external database..."
- Reply: Dave: "Re: Query an external database..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|