|
-
Jan 26th, 2000, 11:36 AM
#19
Addicted Member
Hi WadeD,
Hope you are still looking at this topic because I tried exacly what you want to know several times... and found out a way to work around it...
instead of using a SQL statement, Just use a record set with the AddNew method...
The thing is that in SQL, string values are quoted between apostophes as so: 'YOURSTRING'
now if you put another apostrophe in that string value, it's like you are saying that the string end right there.... (Still folowing me? )
Using recordsets is not really slower than SQL statements (Haven't actualy timed it but never had problems)
so you can try something like this:
Dim DB As Database
Dim rst As RecordSet
Set DB = OpenDatabase(PATH_OF_YOUR_DATABASE)
Set rst = DB.OpenRecordSet("SELECT * FROM MainRep")
rst.AddNew
rst![Service Description] = "Can't"
rst.update
DB.Close
rst.Close
Set DB = Nothing
Set rst = Nothing
Now using that in a loop won't be slower than using a SQL statement in a loop..
Hope it helps!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|