I was wondering if anyone could help me on this, im having trouble with the last elseif, for some reason when i try and use MEMO in the access database it only lets me put in like 20 characters or something so im having to put in 3 description boxes in the database to allow me to put in 750 characters, but when im trying to split the text up i can get -
If Len(Text4.Text) <= 250 Then
-
rs!Description = Text4.Text
-
rs!Description2 = ""
-
rs!Description3 = ""
-
ElseIf Len(Text4.Text) > 250 And Len(Text4.Text) <= 500 Then
-
rs!Description = Left(Text4.Text, 250)
-
rs!Description2 = Right(Text4.Text, Len(Text4.Text) - 250)
-
rs!Description3 = ""
-
to work but when i try and add the 2nd elseif it just keeps crashing on me -
ElseIf Len(Text4.Text) > 500 And Len(Text4.Text) <= 750 Then
-
rs!Description = Left(Text4.Text, 250)
-
rs!Description2 = Right(Text4.Text, Len(Text4.Text) - 250)
-
rs!Description3 = Right(Text4.Text, Len(Text4.Text) - 500)
-
End If
-
If anyone can show me a better way of doing this then i would be most greatful or tell me how to make the memo section on the access database accept more than a few characters, i always beleived that a memo field was unlimited in characters or something... a full view of the desciption code is below if anyone could help i would be most greatful
Kind Regards as always
Devon. -
Do While Not rs.EOF
-
If rs!filmname = Label7.Caption And rs!cdnumber = Label5.Caption And _
-
rs!filmgenre = Label9.Caption And rs!filmtype = Label11.Caption Then
-
rs!cdnumber = Text2.Text
-
rs!filmname = Text3.Text
-
rs!filmgenre = Combo1.Text
-
rs!filmtype = Combo2.Text
-
rs!filmrating = Text6.Text
-
rs!dateadded = Text7.Text
-
If Len(Text4.Text) <= 250 Then
-
rs!Description = Text4.Text
-
rs!Description2 = ""
-
rs!Description3 = ""
-
ElseIf Len(Text4.Text) > 250 And Len(Text4.Text) <= 500 Then
-
rs!Description = Left(Text4.Text, 250)
-
rs!Description2 = Right(Text4.Text, Len(Text4.Text) - 250)
-
rs!Description3 = ""
-
ElseIf Len(Text4.Text) > 500 And Len(Text4.Text) <= 750 Then
-
rs!Description = Left(Text4.Text, 250)
-
rs!Description2 = Right(Text4.Text, Len(Text4.Text) - 250)
-
rs!Description3 = Right(Text4.Text, Len(Text4.Text) - 500)
-
End If
-
rs.Update
-
End If
-
5 2074
I was wondering if anyone could help me on this, im having trouble with the last elseif, for some reason when i try and use MEMO in the access database it only lets me put in like 20 characters or something so im having to put in 3 description boxes in the database to allow me to put in 750 characters, but when im trying to split the text up i can get -
If Len(Text4.Text) <= 250 Then
-
rs!Description = Text4.Text
-
rs!Description2 = ""
-
rs!Description3 = ""
-
ElseIf Len(Text4.Text) > 250 And Len(Text4.Text) <= 500 Then
-
rs!Description = Left(Text4.Text, 250)
-
rs!Description2 = Right(Text4.Text, Len(Text4.Text) - 250)
-
rs!Description3 = ""
-
to work but when i try and add the 2nd elseif it just keeps crashing on me -
ElseIf Len(Text4.Text) > 500 And Len(Text4.Text) <= 750 Then
-
rs!Description = Left(Text4.Text, 250)
-
rs!Description2 = Right(Text4.Text, Len(Text4.Text) - 250)
-
rs!Description3 = Right(Text4.Text, Len(Text4.Text) - 500)
-
End If
-
If anyone can show me a better way of doing this then i would be most greatful or tell me how to make the memo section on the access database accept more than a few characters, i always beleived that a memo field was unlimited in characters or something... a full view of the desciption code is below if anyone could help i would be most greatful
Kind Regards as always
Devon. -
Do While Not rs.EOF
-
If rs!filmname = Label7.Caption And rs!cdnumber = Label5.Caption And _
-
rs!filmgenre = Label9.Caption And rs!filmtype = Label11.Caption Then
-
rs!cdnumber = Text2.Text
-
rs!filmname = Text3.Text
-
rs!filmgenre = Combo1.Text
-
rs!filmtype = Combo2.Text
-
rs!filmrating = Text6.Text
-
rs!dateadded = Text7.Text
-
If Len(Text4.Text) <= 250 Then
-
rs!Description = Text4.Text
-
rs!Description2 = ""
-
rs!Description3 = ""
-
ElseIf Len(Text4.Text) > 250 And Len(Text4.Text) <= 500 Then
-
rs!Description = Left(Text4.Text, 250)
-
rs!Description2 = Right(Text4.Text, Len(Text4.Text) - 250)
-
rs!Description3 = ""
-
ElseIf Len(Text4.Text) > 500 And Len(Text4.Text) <= 750 Then
-
rs!Description = Left(Text4.Text, 250)
-
rs!Description2 = Right(Text4.Text, Len(Text4.Text) - 250)
-
rs!Description3 = Right(Text4.Text, Len(Text4.Text) - 500)
-
End If
-
rs.Update
-
End If
-
there is a problem in memo that it can accept only first line i.e. whenevr it encounters vbcrlf then it leaves remaining value so try to use the code -
-
Conn.Execute "insert into temp(ff) values('" & Replace(Text1.Text, vbCrLf, "##") & "')"
-
where conn is thy connection (ADODB) ff is memo filed in temp tbl
here i'm replacing vbcrlf with ## so the large value can be inserted without vbcrlf
whenevr u 'll retriuve this value just replace ## with vbcrlf and thy problem will be get solved
u need not to use three decription fileds
Try it
Good Luck
Im afraid that its not working, ive tried it but its still only allowing a total of 50 characters into it, the text is mainly on one line anyway as it is a description field of a film, sometimes enter is pressed to give space but not often, but anything i try to enter in the Microsoft Access database under memo only allows me 50 chars, here the connection string im using. -
Set rs = New ADODB.Recordset
-
rs.Open Source:="filmdatabase", _
-
ActiveConnection:=conn, _
-
CursorType:=adOpenDynamic, _
-
LockType:=adLockOptimistic
-
Do While Not rs.EOF
-
If rs!filmname = Label7.Caption And rs!cdnumber = Label5.Caption And _
-
rs!filmgenre = Label9.Caption And rs!filmtype = Label11.Caption Then
-
rs!cdnumber = Text2.Text
-
rs!filmname = Text3.Text
-
rs!filmgenre = Combo1.Text
-
rs!filmtype = Combo2.Text
-
rs!filmrating = Text6.Text
-
rs!dateadded = Text7.Text
-
rs!maindescription = Replace(Text4.Text, vbCrLf, "##")
-
rs.Update
-
End If
-
-
rs.MoveNext
-
Loop
-
ive replaced the Description, Description2, Description3 with maindescription (maindescription is the memo field) any help as always will be greatly appreciated.
Kind Regards
Devon
Im afraid that its not working, ive tried it but its still only allowing a total of 50 characters into it, the text is mainly on one line anyway as it is a description field of a film, sometimes enter is pressed to give space but not often, but anything i try to enter in the Microsoft Access database under memo only allows me 50 chars, here the connection string im using. -
Set rs = New ADODB.Recordset
-
rs.Open Source:="filmdatabase", _
-
ActiveConnection:=conn, _
-
CursorType:=adOpenDynamic, _
-
LockType:=adLockOptimistic
-
Do While Not rs.EOF
-
If rs!filmname = Label7.Caption And rs!cdnumber = Label5.Caption And _
-
rs!filmgenre = Label9.Caption And rs!filmtype = Label11.Caption Then
-
rs!cdnumber = Text2.Text
-
rs!filmname = Text3.Text
-
rs!filmgenre = Combo1.Text
-
rs!filmtype = Combo2.Text
-
rs!filmrating = Text6.Text
-
rs!dateadded = Text7.Text
-
rs!maindescription = Replace(Text4.Text, vbCrLf, "##")
-
rs.Update
-
End If
-
-
rs.MoveNext
-
Loop
-
ive replaced the Description, Description2, Description3 with maindescription (maindescription is the memo field) any help as always will be greatly appreciated.
Kind Regards
Devon
see i've checked this code on more than 200 chars with vbcrlf as line seperetor and its working fine
see i've checked this code on more than 200 chars with vbcrlf as line seperetor and its working fine
try to use connection object as i've given in example
But the problem being im not inserting, im updating and you have to use a different type of connection, plus ive even tried to use visdata to manually edit the field and even in visdata it doesnt let me go over 50 characters, the insert into clause isnt required here that is why im using rs!update, would it be worth using another database type or instead of using ADODB ? i only use it as its the only one i know how to use. And there isnt so much a vbcrlf as line seperator, its mainly one line of text in a text box wordwrapped.
Apologies for being a pain
Kind Regards
Devon.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Patrick |
last post by:
I understand that with IIS5.1 on Windows XP Professional SP1, I can
1) Either set under IIS Manager-> Any specific Virtual Directory->
Configuration->Options->ASP Script timeout for all pages...
|
by: elcc1958 |
last post by:
I need to support a VB6 application that will be receiving
disconnected ADODB.Recordset from out DotNet solution. Our dotnet
solution deals with System.Data.DataTable. I need to populate a...
|
by: Channing Jones |
last post by:
Hello everyone,
I am trying to store data in a binary field of an SQL-Server table using
ADODB.
So far, I have managed to store a record but not any data in the binary
field.
I only get...
|
by: pramodrepaka |
last post by:
i am not able to add records with the help of ADODB. what is the problem i am not able to understand please help me. this is the code i written
In General Declaration
Dim cn As New...
|
by: dmckenna |
last post by:
I've been tasked to upgrade an old system and there's many different versions of VB code that uses MDAC to talk to MSSql. Do you know what the difference is between the two code versions? Is there...
| |
by: mark_aok |
last post by:
Hi all,
All I am trying to do is open a table, edit it, and then close it.
But I am having the strangest error. Here is my code
Dim i as integer
Dim rs as adodb.recordset
Set rs = new...
|
by: PCroser |
last post by:
I have encountered a problem when querying a table.
The query passed data into a recordset which should have resulted in many records but has returned EOF.
After debugging the code the only...
|
by: sphinney |
last post by:
All,
I have a ADODB.Recordset in my Access 2002 project. I've been able to successfully add fields to the record set. According the the MS Access help files, I now must update the recordset to...
|
by: chuckzter |
last post by:
Hey guys,
I would like to know how to replace values in your database via ADODB.
Example:
(I would want to replace the value LOCATION of ID 1001 which is Oliver to Laguna.)
ID NAME...
|
by: bmallett |
last post by:
I am getting the following error:
Error Type:
ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another....
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |