Avatar billede ibrene Nybegynder
10. maj 2002 - 10:52 Der er 32 kommentarer og
1 løsning

Kan ikke vise tekst fra memo felt

Jeg har et lidt mærkeligt problem...

Jeg har et tekst felt med 255 karakter i, som jeg selecter med en SQL fra asp i en acces database...

Dette går unden nogle problemer.

Men vælger jeg at lave dette felt om til et memo felt, så kommer der ikke noget output ud.

Jeg forstår det sku ikke rigtigt, fordi alle de andre variabler som bliver hentet i samme SQL-string bliver stadig vist.

Nogle som har et godt savr på dette?

mvh
ibrene
Avatar billede proaccess Nybegynder
10. maj 2002 - 10:56 #1
Er du HELT sikker på at der stadig er tekst i memo-feltet...?

Hvis du SLETTEDE dit oprindelige tekstfelt, og oprettede et nyt memofelt, så er der jo ingen data...
Avatar billede ibrene Nybegynder
10. maj 2002 - 10:59 #2
Jeg har ikke slettet det, men lavet det om inde i "Design View" og efter at jeg laver det om der inde, så kan det ikke vises. Henter jeg databasen ind i acces, så kanjeg godt se de data som ligger der.
Avatar billede proaccess Nybegynder
10. maj 2002 - 11:07 #3
Udemærket...  (BTW: Du behøver ikke at afvise hvert eneste svar, før end du får din løsning)

Har du nogen form for gruppering eller sortering på dit memofelt...? Det kan man nemlig ikke...

Prøv at lade mig se din SQL-string... (så er det nemmere at se, hvad der går galt)
Avatar billede proaccess Nybegynder
10. maj 2002 - 11:07 #4
DIT FELT HEDDER VEL STADIG DET SAMME ???
Avatar billede ibrene Nybegynder
10. maj 2002 - 11:42 #5
Hejsa

Det ser sådanne ud og ja mit felt hedder stadig det samme....

                                      strSQL = ("Select id, tekst from usr_news where usr_id = " & usr_id & "")
                                    Set rs = Conn.Execute(strSQL) 
                                        Do 
                                              if rs("tekst") = "" then
                                                nonews = "Ingen nyheder..."
                                              Response.write(nonews)
                                            else
                                              tekst = rs("tekst")
                                              Response.write(tekst)
                                              Response.write("</p></span>")
                                            end if
       
                                    rs.MoveNext 
                                    Loop While Not rs.EOF 
                                    rs.close
Avatar billede hansk Nybegynder
10. maj 2002 - 12:08 #6
hej ibrene,

Jeg har tidligere haft samme problem. Mit problem var at jeg hentede data via en ODBC forbindelse, og den driver jeg benyttede ikke supporterede strenge længere end 256 karakterer. Kan dette være dit problem?
Avatar billede terry Ekspert
10. maj 2002 - 14:51 #7
If userID is a text field then try
strSQL = "Select id, tekst from usr_news where usr_id = '" & usr_id & "'"

If userID is a numeric field then try
strSQL = "Select id, tekst from usr_news where usr_id = " & usr_id
Avatar billede terry Ekspert
10. maj 2002 - 15:13 #8
I would also check to make sur ethat you are actually finding records in your select no need to waist time trying to show something you may not even have :o)

do until rs.eof
'This stops IF There are no reocards
loop

do
'This will loop ONCE even if there are NO records
loop while NOT rs.eof
Avatar billede terry Ekspert
10. maj 2002 - 16:03 #9
You need to look at the AppendChunk and GetChunk methods for handling memo fields but first you can try to select just a part of the memo field

strSQL = "Select id, Left(tekst,255) As First255 from usr_news where usr_id = '" & usr_id & "'"
Avatar billede terry Ekspert
10. maj 2002 - 16:09 #11
then look in ADO Method smenu after AppendChunck and GetChunck
Avatar billede terry Ekspert
10. maj 2002 - 19:16 #12
If you look at Microsoft http://www.msdn.microsoft.com/
and search for GetChunk you will find a number of links some of them with examples you can download!
Avatar billede terry Ekspert
10. maj 2002 - 19:18 #13
Here is an example:
AppendChunk, GetChunk Methods Example

The following example appends data to the Notes field for each record in an Employees table. The data type of the Notes field is Memo. The procedure returns the contents of the field by using the GetChunk method, adds to the data, and appends the altered data back to the Notes field by using the AppendChunk method.

Sub AddToMemo()
Dim cnn As ADODB.Connection, rst As New ADODB.Recordset
Dim fldFirstName As ADODB.Field
Dim fldLastName As ADODB.Field
Dim fldNotes As ADODB.Field
Dim lngSize As Long, strChunk As String

Set cnn = CurrentProject.Connection
rst.Open "Employees", cnn, adOpenKeyset, adLockOptimistic
With rst
Set fldNotes = !Notes
Set fldFirstName = !FirstName
Set fldLastName = !LastName
Do Until .EOF
If IsNull(fldNotes.Value) Then
strChunk = fldFirstName & " " & fldLastName & " is an excellent employee."
!Notes = strChunk
.MoveNext
Else
lngSize = Len(fldNotes)
strChunk = fldNotes.GetChunk(lngSize)
strChunk = strChunk & " " & fldFirstName & " " & fldLastName & " is and excellent Employee."
!Notes = " "
!Notes.AppendChunk strChunk
.MoveNext
End If
Loop
End With
rst.Close
cnn.Close
End Sub
10. maj 2002 - 20:20 #14
7 svar i træk, Terry....en hel lille monolog ;o)
Avatar billede ibrene Nybegynder
11. maj 2002 - 13:20 #15
Nogle ide om, hvor jeg så kan få en ny ODBC driver... for der er noget som typer på at det er problemet.

mvh
ibrene

PS: Takf or de mange svare indtil videre.
Avatar billede terry Ekspert
11. maj 2002 - 18:28 #16
ibrene, a new ODBC driver! Isnt your application on the WEB? If that is the case then it is your provider that needs a new ODBC driver (SERVER SIDE)!
If you have your own server then you could try downloading the newesst drivers from Microsoft!
Avatar billede terry Ekspert
11. maj 2002 - 18:31 #17
http://www.microsoft.com/data/download.htm
mdac 2.7 should contain th elatest ADO drivers (2.7)
Avatar billede terry Ekspert
12. maj 2002 - 17:14 #18
ibrene>What makes you think you need an new ODBC driver?
When using memo fields you should use the appendchunk and getchunk methods! HAVE YOU TRIED THIS? If not then please do! I am sure this is the problem!
OR have you tried the answer I gave 10/05-2002 16:03:38?

strSQL = "Select id, Left(tekst,255) As First255 from usr_news where usr_id = '" & usr_id & "'"
Avatar billede ibrene Nybegynder
12. maj 2002 - 17:35 #19
Hi Terry...

I have tried your answer abput the only selecting 255 char and that works, if i write in more then 255 char, it does not give me more. So that's is why i thing it is the ODBC driver.

i have not treid the other solution yet.

ibrene
Avatar billede terry Ekspert
12. maj 2002 - 17:43 #20
Hi ibrene!
Well trying the 255 proves that there is data!
I am VERY usre (99%+) thet you will need to use the appendchunk and getchunk methods, so I think you should try it :o)
Avatar billede ibrene Nybegynder
13. maj 2002 - 16:26 #21
Hi Terry

Would it be to much to ask, to make the code for my, now that you know what i am taken out from the access database.

i do not understand the code you posted, i normaly work with PHP

Thanx

Ibrene
Avatar billede terry Ekspert
13. maj 2002 - 16:48 #22
ibrene>I know NOTHING about PHP, so I wouldnt be able to do it!
If you are using ADO then here is a link:
Avatar billede terry Ekspert
13. maj 2002 - 16:49 #23
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmscadocodeexamples.asp

then select the programming language and look for getchunk and appendchunk
Avatar billede ibrene Nybegynder
13. maj 2002 - 16:52 #24
No the code should still be in ASP... i just mean that i do not no so much about ASP, and that is probely why i get this problem.

So if you could help me, made the shout coding fo ASP, i would be so happy
Avatar billede terry Ekspert
13. maj 2002 - 18:15 #25
ibrene> IF you send EVERYTHING, database and ALL html and ASP pages (ZIPPED) then I will take a look at it when I can find time.
I am NO expert at ASP (this category is Access!) but I may see a problem!
NOTE: Not that everything is about points, but if I do look and cant solve your problem then I dont expect you to reject the answers I have given. So think about it BEFORE you send it :o)
Avatar billede terry Ekspert
13. maj 2002 - 18:35 #26
terry@santhell.dk
Avatar billede terry Ekspert
16. maj 2002 - 19:11 #27
Hi Kasper>Hows it going here, have you got it to work after my suggestions?
Avatar billede terry Ekspert
17. maj 2002 - 18:12 #28
Kasper!!!!!
Avatar billede ibrene Nybegynder
18. maj 2002 - 08:48 #29
I have treid to set

Dim tekst As Long

And it stil not work...
Avatar billede terry Ekspert
18. maj 2002 - 13:20 #30
OK ! cant help you, sorry, but please take not of my comment 13/05-2002 18:15:18


NOTE: Not that everything is about points, but if I do look and cant solve your problem then I dont expect you to reject the answers I have given. So think about it BEFORE you send it :o)
Avatar billede terry Ekspert
19. maj 2002 - 11:02 #31
Kasper! You have sent your application to me again, what do you want me to do?
Do you understand what I write 18/05-2002 13:20:05 ?

mvh
Terry
Avatar billede ibrene Nybegynder
19. maj 2002 - 15:51 #32
Hi Terry

I have given you the points, becourse you are reel helpfull. The problem is still not working, but i have given up. My knowlegde is in PHP and not ASP, so the one i has been helping much solve his own problem.

Thanx for using the time and come up with some great input.

Ibrene
Avatar billede terry Ekspert
19. maj 2002 - 18:25 #33
thanks Kasper>I'm sorry I couldnt help you get it to work :o)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester