Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
MS Access select and delete
Old 08-15-2006, 08:45 AM MS Access select and delete
Novice Talker

Posts: 10
Name: Daion Doroga
Trades: 0
Hi
I am a new member and very new to database. I am having problem with MS Access data base. Example my text is "xyz" in a text field, txtField. Is there any way to run a query to delete x and z so I am left with y only. Can anyone help please...

Regards
__________________

Please login or register to view this content. Registration is FREE


Affordable web design, web application development, content management systems and ecommerce solutions for small business
daiondoroga is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-15-2006, 06:48 PM Re: MS Access select and delete
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
not in a single query,

you would need to read the data, process it in some code or other, then update the database record with the new data.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-15-2006, 10:23 PM Re: MS Access select and delete
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
In a single text field, it would be possible. The problem is before the query, you'd have to do some sort of manipulation.
Code:
Dim Delete_1, Delete_2
Delete_1 = Mid (your form field, 1, 1)
Delete_2 = Mid (your form field, 3, 1)
SQL_Query = "Delete from (table) where (field) In ('" & Delete_1 & "', '" & Delete_2 & "')
Conn.Execute (SQL_Query)
That's rough code. Very rough code. Play with it and make it better, but it's the rough idea.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 08-16-2006, 04:11 AM Re: MS Access select and delete
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Adam, your query would delete records where the field contained the values of Delete_1 or Delete_2 would it not.

It seemed to me that the OP wants to do string manipulation within the SQL Server (Access) context. Which would need stored procedures to accomplish in a single query.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-16-2006, 11:55 AM Re: MS Access select and delete
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
That's exactly what it would do. It would delete those two values, which would have to be extracted from the text field.

As far as SPs used to accomplish this in a query...I'm not that good with them so I really wouldn't know. The easiest way I could personally see to do it is ASP string manipulation.

Mind you, a little more clarification is probably in order at this point. diaondoroga, what exactly did you want to accomplish?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to MS Access select and delete
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.17794 seconds with 12 queries