Article View: borland.public.cppbuilder.database.ado
Article #2141Re: SQL Create Table with Double type field
From: Daniel
Date: Thu, 23 Oct 2003 06:31
Date: Thu, 23 Oct 2003 06:31
133 lines
5486 bytes
5486 bytes
Sorry, I was wrong. The script worked fine, but if I use the same SQL
statement from within my program it fails when I try and assign a field as a
'Float' datatype.
How come the SQL statement from a JScript works but fails when the same SQL
statement is used from within a Builder component? ...when they are both
being operated against the same MS Access database?
can anyone explain this?
"Daniel" <admin@netcomm.com> wrote in message
news:3f95c6f9$1@newsgroups.borland.com...
> I seem to not be able to execute the SQL string "Create table [MyTable]
> ([Field1] Float, [Field2] Float)", the error is that it doesn't recognise
> what a 'Float' is, if I replace that with 'Integer', or 'Currency', or
> 'DateTime' then it all works.
>
> I'm assuming from what you are saying that this is because my MDAC is not
up
> to date. I will have a look at updating my MDAC then try again.
>
> I wasn't aware that MDAC affected the SQL Commands an Access Database
could
> recognise.
>
>
> "Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
> news:3f937652@newsgroups.borland.com...
> > Try save these strings into test.js file and execute it:
> >
> > //--------------------
> > var connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb;";
> >
> > var cat = new ActiveXObject("ADOX.Catalog");
> > cat.Create(connStr);
> > cat = null;
> >
> > var conn = new ActiveXObject("ADODB.Connection");
> > conn.Open(connStr);
> >
> > conn.Execute("Create table [MyTable] ([Field1] Float, [Field2] Float)");
> > //---------------------
> >
> > If it does not work, update your MDAC
> (http://www.microsoft.com/downloads/)
> > and Jet SP (http://www.microsoft.com/data/).
> >
> > For help on MS Jet (MS Access) SQL look for file jsetsql40.chm if you
have
> > MS Office installed. It may be located at: "C:\Program Files\Common
> > Files\Microsoft Shared\Office10\XXXX\JETSQL40.CHM", where XXXX is
language
> > id, 1033 for US English.
> >
> > //----------------------
> > Regards,
> > Viatcheslav V. Vassiliev
> > http://www.oledbdirect.com
> > The fastest way to access MS SQL Server,
> > MS Jet (Access) and Interbase (through OLEDB)
> >
> >
> >
> > "Daniel" <admin@netcomm.com> �������/�������� � �������� ���������:
> > news:3f9321e3$1@newsgroups.borland.com...
> > > Thanks for your help Viatcheslav,
> > >
> > > but unfortunately the data_type 'Float' doesn't work when using it
with
> a
> > MS
> > > Access database. I have been searching endlessly to find
documentation
> > for
> > > this, but can't seem to find anywhere where it clarifies the
data_types
> > > available when operating with a MS Access database.
> > >
> > > the data_types I have been using so far (unsucessfully) are: Float,
> > Double,
> > > Decimal(n,m), Long Integer, LongInt, Long.
> > >
> > > I have a feeling that I have to first set the field to Integer than
> > somehow
> > > change it the type of integer to be a Double, but I can't seem to work
> out
> > > whether this theory is correct.
> > >
> > > If anyone is a wiz with MS Access and/or know of a book or web site
that
> > may
> > > assist in this area than I would more than greatful.
> > >
> > >
> > >
> > > "Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
> > > news:3f8fafca@newsgroups.borland.com...
> > > > CREATE TABLE myTable(Field1 Float, Field2 Float)
> > > >
> > > > You may find info on column types in documentation for your DBMS.
> > > >
> > > > //----------------------
> > > > Regards,
> > > > Viatcheslav V. Vassiliev
> > > > http://www.oledbdirect.com
> > > > The fastest way to access MS SQL Server,
> > > > MS Jet (Access) and Interbase (through OLEDB)
> > > >
> > > >
> > > > "Daniel" <admin@netcomm.com> �������/�������� � �������� ���������:
> > > > news:3f8f3925$1@newsgroups.borland.com...
> > > > > Does anyone know how to create a table with a Number of type
Double
> as
> > a
> > > > > field.
> > > > >
> > > > > CREATE TABLE mytable (Field1 data_type, Field2 data_type)
> > > > >
> > > > > what is the data_type for creating a field of type Double?
> > > > >
> > > > > Thanks
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID:
<3f9775ca@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f8f3925$1@newsgroups.borland.com> <3f8fafca@newsgroups.borland.com> <3f9321e3$1@newsgroups.borland.com> <3f937652@newsgroups.borland.com> <3f95c6f9$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,d7d2d8886914c651 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-10-22 23:39:06 PST From: "Daniel" <admin@netcomm.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3f8f3925$1@newsgroups.borland.com> <3f8fafca@newsgroups.borland.com> <3f9321e3$1@newsgroups.borland.com> <3f937652@newsgroups.borland.com> <3f95c6f9$1@newsgroups.borland.com> Subject: Re: SQL Create Table with Double type field Date: Thu, 23 Oct 2003 16:31:36 +1000 Lines: 135 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 202.174.228.150 Message-ID: <3f9775ca@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1066890698 202.174.228.150 (22 Oct 2003 23:31:38 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail