RE: mysql is driving me mad (3)

2002-09-01 Thread Bob G


my sql problem

Thanks for the mild rebuke paul.

I (re) created the table as follows ;-

drop table clients;
create table clients(
purchasers_ID int,
purchasers_name varchar (50),
purchase_ID int,
price decimal (7,2),
dated varchar(50)
);

I put the data away thus :-

Set objConn = Server.CreateObject(ADODB.Connection)
strConn = Data Source= ArtSales ; User ID= ;Password= ;
objConn.Open strConn

 Set  objRS = Server.CreateObject(ADODB.Recordset)
  objRS.CursorLocation = adUseServer
  objRS.CursorType = adOpenStatic
  objRS.LockType = adLockOptimistic
  objRS.Open Orders, objConn, , , adCmdTable
  obJRS.MoveLast
  objRS.Update
  Session(customerName)  = objRS(Customer_Name)
  Session(customerID) = objRS(OrderID)
  objRS.close
  objRS.Open Clients, objConn, , , adCmdTable
objRS.AddNew
objRS(Purchasers_name) = Session(customerName) ** this is
the culprit *
  objRS(purchasers_id) =  Session(customerID)
ObjRS(purchase_ID) =  Session(product_id)
  objRS(Price) =  Session(value)
  objRS(dated) =   now()
objRS.Update
  objRS.close
%
Anything less than 15 characters works o.k. anything more it produces 
an
error.

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
Multiple-step OLE DB operation generated errors. Check each OLE DB status
value, if available. No work was done.
/Art_2/TMP287uj1ry6h.asp, line 40

Given that I have given it 50 charachters to work with I don't understand
what it can complain about. But then as I said I am very new. The other two
databases work fine using the same methods!

Thanks and regards Bob




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: mysql is driving me mad (3)

2002-09-01 Thread Paul DuBois

At 20:56 +0100 9/1/02, Bob G wrote:
my sql problem

Thanks for the mild rebuke paul.

Not a rebuke, really.  It's just that people cannot help you without
information.


I (re) created the table as follows ;-

drop table clients;
create table clients(
   purchasers_ID int,
   purchasers_name varchar (50),
   purchase_ID int,
   price decimal (7,2),
   dated varchar(50)
);

Looks okay.  Below you show a program for inserting records into the
table.  What happens if you use the mysql program from the command line
to insert records into the table that have values longer than 15 characters?
Does it work?  If so, then the the problem will be due to something about
your program.


I put the data away thus :-

Set objConn = Server.CreateObject(ADODB.Connection)
strConn = Data Source= ArtSales ; User ID= ;Password= ;
objConn.Open strConn

  Set  objRS = Server.CreateObject(ADODB.Recordset)
   objRS.CursorLocation = adUseServer
   objRS.CursorType = adOpenStatic
   objRS.LockType = adLockOptimistic
   objRS.Open Orders, objConn, , , adCmdTable
   obJRS.MoveLast
   objRS.Update
   Session(customerName)  = objRS(Customer_Name)
 Session(customerID) = objRS(OrderID)
 objRS.close
 objRS.Open Clients, objConn, , , adCmdTable
 objRS.AddNew
 objRS(Purchasers_name) = Session(customerName) ** this is
the culprit *
 objRS(purchasers_id) =  Session(customerID)
 ObjRS(purchase_ID) =  Session(product_id)
 objRS(Price) =  Session(value)
 objRS(dated) =   now()
 objRS.Update
 objRS.close
%
   Anything less than 15 characters works o.k. anything 
more it produces an
error.

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
Multiple-step OLE DB operation generated errors. Check each OLE DB status
value, if available. No work was done.
/Art_2/TMP287uj1ry6h.asp, line 40

Given that I have given it 50 charachters to work with I don't understand
what it can complain about. But then as I said I am very new. The other two
databases work fine using the same methods!

You mean you have 50-char columns in those databases and you can insert
more than 15 characters into them?


Thanks and regards Bob


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: mysql is driving me mad (3)

2002-09-01 Thread Tom Emerson

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Subject: [which I usually snip as it's redundant]
   Re: RE: mysql is driving me mad (3)
[however it appears it would have avoided this:]
 Your message cannot be posted because it appears to be either spam or
 simply off topic to our filter.[...]
 first review the text of the message to make sure it has [a keyword
of sql, query, or (I presume) MySQL]
 -Original Message-
 From: Bob G [mailto:[EMAIL PROTECTED]]
[...]
 I (re) created the table as follows ;-
 create table clients(
 [...] purchasers_name varchar (50),[...] );

 I put the data away thus :-

  Set  objRS = Server.CreateObject(ADODB.Recordset)
[...]
 objRS(Purchasers_name) = Session(customerName)
 ** this is the culprit *
[...]
 objRS.Update
 Anything less than 15 characters works o.k.
 anything more it produces an error.

Here is a screwy question for you: is the length of the
VERY FIRST item you put into this set 15 characters?  I
ran into a similar problem where the first time I
opened a dataset I could enter values for any length up
to the actual maximum, but after I closed the set and
re-opened it (i.e, the next time the program ran), the
longest item in the set determined the maximum length.

IT TURNS OUT that in the myodbc connector/driver, there is
a page of options -- you need to ensure bit 1 (client can't
handle the real length) is set.  Bit 2 may be of use as well,
(though I can't remember off the top of my head what it is --
I just know I have it set)  This bit of info was gleaned
from an example in the anual that used an option value of 3
(and, of course, little explanantion as to WHY that particular
option value was chosen...)

Well, what do you know -- I didn't actually use one of those keywords in my
message after all...


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php