Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
ASP - citanje iz access baze

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
herka



Joined: 24 Oct 2004
Posts: 2

PostPosted: 24.10.2004 23:21    Post subject: ASP - citanje iz access baze Add user to your forum ignore list Reply with quote

dakle problem je slijedeci.
imam bazu u accessu i citam iz nje text (MEMO). kak napravim da mi procita prvih recimo 200 znakova i ondak nadje prvi space " " i tu stane?

danke!

_________________
--
herka
--
Back to top
View user's profile Send private message Visit poster's website
Tompa



Joined: 14 Oct 2004
Posts: 64
Location: Prudnice

PostPosted: 25.10.2004 08:26    Post subject: memo polje Add user to your forum ignore list Reply with quote

hm, ovak na brzinu:
pretpostavljam da zelis prvih 200 znakova i sve ostale znakove do prvog spacea;
u varijablu ucitati vrijednost memo polja, npr u $memo;

$prvi space=instr(200, $memo, " ")
$broj=$prvi_space-200
$prvih_200=Len($memo, 200) & mid($memo, 200, &broj)

prvo potrazimo na kojem se mjestu nalazi prvi space poslije 200tog znaka
izracunamo koliko je space udaljen od 200tog znaka
i na kraju uzmemo prvih 200 i dodamo ostatak.

malo jednostavnije i krace:
$prvi space=instr(200, $memo, " ")
$broj=$prvi_space-200
$prvih_200=Len($memo, 200+$broj)

hm, nadam se da ce djeljati...
Back to top
View user's profile Send private message Visit poster's website
carr



Joined: 13 Nov 2003
Posts: 1397
Location: Karlovac

PostPosted: 25.10.2004 19:08    Post subject: Add user to your forum ignore list Reply with quote

hm, cinimise da je ovo tompino php, a ako covjek koristi Access bazu vjerojatno je platforma u pitanju ASP. uglavnom mislim da bi ovo trebalo raditi

Code:

Function DAJ_MI(patrn, string)
   regEx.Pattern = patrn
   regEx.IgnoreCase = True
   regEx.Global = True   
   Set Matches = regEx.Execute(string)

   rjesenje=left(string, 200)   
   string=mid(string, 200, len(string))

   For Each Match in Matches
       temp=Match.FirstIndex
      rjesenje=rjesenje & mid(strng, 0, temp)
     exit for
   next
   DAJ_MI=rjesenje
End function


patrn argument ti je karakter koji trazi (u tvom slucaju razmak), a string je ulazni string koji procitas iz memo polja.
moguce da ima nekih bagova, nisam testirao, al trebalo bi raditi bar nacelno

_________________
Bolje biti malo lud, nego malo pametan.
Back to top
View user's profile Send private message Visit poster's website
herka



Joined: 24 Oct 2004
Posts: 2

PostPosted: 25.10.2004 19:15    Post subject: Re: memo polje Add user to your forum ignore list Reply with quote

danke svima!

_________________
--
herka
--
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group