I am trying to write to a text file using JET and
ADO.NET, however I am getting the "syntax error in insert
into statement" even though my column names are all
original. I think the problem is with the
OleDbCommandBuilder as when I build an INSERT statement
for the OleDbCommand manually it writes successfully to
the text file. Is this a known problem? Here are my
details;

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents
and Settings\Administrator\My Documents\Visual Studio
Projects\Aurora\bin\Data\;Extended
Properties=Text;Persist Security Info=False

[Body for Tesco Events.prn]
Format=FixedLength
Col1=Event Text Width 6
Col2=Junk Text Width 2
Col3=Description Text Width 29
Col4=Type Text Width 1

Thanks, Robby

Re: OleDbCommandBuilder Isnt Building... by William

William
Wed Jan 07 20:02:20 CST 2004

Robby, a CommandBuilder needs a Primary Key to work and AFAIK, using text as
a source or Excel for instance won't do it for you.
"Robby.White@Here.Now" <anonymous@discussions.microsoft.com> wrote in
message news:05a001c3d589$e1006080$a401280a@phx.gbl...
> I am trying to write to a text file using JET and
> ADO.NET, however I am getting the "syntax error in insert
> into statement" even though my column names are all
> original. I think the problem is with the
> OleDbCommandBuilder as when I build an INSERT statement
> for the OleDbCommand manually it writes successfully to
> the text file. Is this a known problem? Here are my
> details;
>
> Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents
> and Settings\Administrator\My Documents\Visual Studio
> Projects\Aurora\bin\Data\;Extended
> Properties=Text;Persist Security Info=False
>
> [Body for Tesco Events.prn]
> Format=FixedLength
> Col1=Event Text Width 6
> Col2=Junk Text Width 2
> Col3=Description Text Width 29
> Col4=Type Text Width 1
>
> Thanks, Robby
>



Re: OleDbCommandBuilder Isnt Building... by Fred

Fred
Wed Jan 07 20:33:09 CST 2004

Try something like this (don't have my code right in front of me, so this
might not be 100% accurate):

Dim aPK(1) As Object ' example of two column Primary Key
aPK(0) = "F1"
aPK(1) = "F2"
ds.PrimaryKey = aPK ' not sure if this line is correct, but it's pretty
close

' Do all of the above prior to invoking Fill method.

"Robby.White@Here.Now" <anonymous@discussions.microsoft.com> wrote in
message news:05a001c3d589$e1006080$a401280a@phx.gbl...
> I am trying to write to a text file using JET and
> ADO.NET, however I am getting the "syntax error in insert
> into statement" even though my column names are all
> original. I think the problem is with the
> OleDbCommandBuilder as when I build an INSERT statement
> for the OleDbCommand manually it writes successfully to
> the text file. Is this a known problem? Here are my
> details;
>
> Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents
> and Settings\Administrator\My Documents\Visual Studio
> Projects\Aurora\bin\Data\;Extended
> Properties=Text;Persist Security Info=False
>
> [Body for Tesco Events.prn]
> Format=FixedLength
> Col1=Event Text Width 6
> Col2=Junk Text Width 2
> Col3=Description Text Width 29
> Col4=Type Text Width 1
>
> Thanks, Robby
>



Re: OleDbCommandBuilder Isnt Building... by Robby

Robby
Wed Jan 07 21:30:51 CST 2004

I have tried adding a primary key after the fill and then
creating the command builder but this did not work. Does
this mean ADO.NET cannot write to text files using Jet?
This cannot be? By the way what does AFAIK mean?

>-----Original Message-----
>Robby, a CommandBuilder needs a Primary Key to work and
AFAIK, using text as
>a source or Excel for instance won't do it for you.
>"Robby.White@Here.Now"
<anonymous@discussions.microsoft.com> wrote in
>message news:05a001c3d589$e1006080$a401280a@phx.gbl...
>> I am trying to write to a text file using JET and
>> ADO.NET, however I am getting the "syntax error in
insert
>> into statement" even though my column names are all
>> original. I think the problem is with the
>> OleDbCommandBuilder as when I build an INSERT statement
>> for the OleDbCommand manually it writes successfully to
>> the text file. Is this a known problem? Here are my
>> details;
>>
>> Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Documents
>> and Settings\Administrator\My Documents\Visual Studio
>> Projects\Aurora\bin\Data\;Extended
>> Properties=Text;Persist Security Info=False
>>
>> [Body for Tesco Events.prn]
>> Format=FixedLength
>> Col1=Event Text Width 6
>> Col2=Junk Text Width 2
>> Col3=Description Text Width 29
>> Col4=Type Text Width 1
>>
>> Thanks, Robby
>>
>
>
>.
>

Re: OleDbCommandBuilder Isnt Building... by anonymous

anonymous
Wed Jan 07 21:31:44 CST 2004

I have tried adding a primary key but can only do it
after the fill as it needs appended to the table not the
dataset, i then created the command builder but this did
not work.

>-----Original Message-----
>Robby, a CommandBuilder needs a Primary Key to work and
AFAIK, using text as
>a source or Excel for instance won't do it for you.
>"Robby.White@Here.Now"
<anonymous@discussions.microsoft.com> wrote in
>message news:05a001c3d589$e1006080$a401280a@phx.gbl...
>> I am trying to write to a text file using JET and
>> ADO.NET, however I am getting the "syntax error in
insert
>> into statement" even though my column names are all
>> original. I think the problem is with the
>> OleDbCommandBuilder as when I build an INSERT statement
>> for the OleDbCommand manually it writes successfully to
>> the text file. Is this a known problem? Here are my
>> details;
>>
>> Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Documents
>> and Settings\Administrator\My Documents\Visual Studio
>> Projects\Aurora\bin\Data\;Extended
>> Properties=Text;Persist Security Info=False
>>
>> [Body for Tesco Events.prn]
>> Format=FixedLength
>> Col1=Event Text Width 6
>> Col2=Junk Text Width 2
>> Col3=Description Text Width 29
>> Col4=Type Text Width 1
>>
>> Thanks, Robby
>>
>
>
>.
>

Re: OleDbCommandBuilder Isnt Building... by William

William
Wed Jan 07 22:06:16 CST 2004

As Far as I Know
"Robby White" <Robby.White@Here.Now> wrote in message
news:08d001c3d597$d0a88970$a101280a@phx.gbl...
> I have tried adding a primary key after the fill and then
> creating the command builder but this did not work. Does
> this mean ADO.NET cannot write to text files using Jet?
> This cannot be? By the way what does AFAIK mean?
>
> >-----Original Message-----
> >Robby, a CommandBuilder needs a Primary Key to work and
> AFAIK, using text as
> >a source or Excel for instance won't do it for you.
> >"Robby.White@Here.Now"
> <anonymous@discussions.microsoft.com> wrote in
> >message news:05a001c3d589$e1006080$a401280a@phx.gbl...
> >> I am trying to write to a text file using JET and
> >> ADO.NET, however I am getting the "syntax error in
> insert
> >> into statement" even though my column names are all
> >> original. I think the problem is with the
> >> OleDbCommandBuilder as when I build an INSERT statement
> >> for the OleDbCommand manually it writes successfully to
> >> the text file. Is this a known problem? Here are my
> >> details;
> >>
> >> Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=C:\Documents
> >> and Settings\Administrator\My Documents\Visual Studio
> >> Projects\Aurora\bin\Data\;Extended
> >> Properties=Text;Persist Security Info=False
> >>
> >> [Body for Tesco Events.prn]
> >> Format=FixedLength
> >> Col1=Event Text Width 6
> >> Col2=Junk Text Width 2
> >> Col3=Description Text Width 29
> >> Col4=Type Text Width 1
> >>
> >> Thanks, Robby
> >>
> >
> >
> >.
> >



Re: OleDbCommandBuilder Isnt Building... by Robby

Robby
Wed Jan 07 22:34:24 CST 2004

Ive just written to the text file using ADODB
within .NET, however I would rather not. Can you point
me to the MS source thats states ADO.NET cant write to
text files... there must be a workaround... help! What is
AFAIK?

>-----Original Message-----
>As Far as I Know
>"Robby White" <Robby.White@Here.Now> wrote in message
>news:08d001c3d597$d0a88970$a101280a@phx.gbl...
>> I have tried adding a primary key after the fill and
then
>> creating the command builder but this did not work.
Does
>> this mean ADO.NET cannot write to text files using Jet?
>> This cannot be? By the way what does AFAIK mean?
>>
>> >-----Original Message-----
>> >Robby, a CommandBuilder needs a Primary Key to work
and
>> AFAIK, using text as
>> >a source or Excel for instance won't do it for you.
>> >"Robby.White@Here.Now"
>> <anonymous@discussions.microsoft.com> wrote in
>> >message news:05a001c3d589$e1006080$a401280a@phx.gbl...
>> >> I am trying to write to a text file using JET and
>> >> ADO.NET, however I am getting the "syntax error in
>> insert
>> >> into statement" even though my column names are all
>> >> original. I think the problem is with the
>> >> OleDbCommandBuilder as when I build an INSERT
statement
>> >> for the OleDbCommand manually it writes
successfully to
>> >> the text file. Is this a known problem? Here are my
>> >> details;
>> >>
>> >> Provider=Microsoft.Jet.OLEDB.4.0;Data
>> Source=C:\Documents
>> >> and Settings\Administrator\My Documents\Visual
Studio
>> >> Projects\Aurora\bin\Data\;Extended
>> >> Properties=Text;Persist Security Info=False
>> >>
>> >> [Body for Tesco Events.prn]
>> >> Format=FixedLength
>> >> Col1=Event Text Width 6
>> >> Col2=Junk Text Width 2
>> >> Col3=Description Text Width 29
>> >> Col4=Type Text Width 1
>> >>
>> >> Thanks, Robby
>> >>
>> >
>> >
>> >.
>> >
>
>
>.
>

Re: OleDbCommandBuilder Isnt Building... by Rob

Rob
Thu Jan 08 06:16:51 CST 2004

AFAIK = As Far as I Know

"Robby" <Robby@Here.Now> wrote in message
news:083201c3d5a0$b129dbe0$a301280a@phx.gbl...
> Ive just written to the text file using ADODB
> within .NET, however I would rather not. Can you point
> me to the MS source thats states ADO.NET cant write to
> text files... there must be a workaround... help! What is
> AFAIK?
>
> >-----Original Message-----
> >As Far as I Know
> >"Robby White" <Robby.White@Here.Now> wrote in message
> >news:08d001c3d597$d0a88970$a101280a@phx.gbl...
> >> I have tried adding a primary key after the fill and
> then
> >> creating the command builder but this did not work.
> Does
> >> this mean ADO.NET cannot write to text files using Jet?
> >> This cannot be? By the way what does AFAIK mean?
> >>
> >> >-----Original Message-----
> >> >Robby, a CommandBuilder needs a Primary Key to work
> and
> >> AFAIK, using text as
> >> >a source or Excel for instance won't do it for you.
> >> >"Robby.White@Here.Now"
> >> <anonymous@discussions.microsoft.com> wrote in
> >> >message news:05a001c3d589$e1006080$a401280a@phx.gbl...
> >> >> I am trying to write to a text file using JET and
> >> >> ADO.NET, however I am getting the "syntax error in
> >> insert
> >> >> into statement" even though my column names are all
> >> >> original. I think the problem is with the
> >> >> OleDbCommandBuilder as when I build an INSERT
> statement
> >> >> for the OleDbCommand manually it writes
> successfully to
> >> >> the text file. Is this a known problem? Here are my
> >> >> details;
> >> >>
> >> >> Provider=Microsoft.Jet.OLEDB.4.0;Data
> >> Source=C:\Documents
> >> >> and Settings\Administrator\My Documents\Visual
> Studio
> >> >> Projects\Aurora\bin\Data\;Extended
> >> >> Properties=Text;Persist Security Info=False
> >> >>
> >> >> [Body for Tesco Events.prn]
> >> >> Format=FixedLength
> >> >> Col1=Event Text Width 6
> >> >> Col2=Junk Text Width 2
> >> >> Col3=Description Text Width 29
> >> >> Col4=Type Text Width 1
> >> >>
> >> >> Thanks, Robby
> >> >>
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >