|
-
Jun 3rd, 2003, 02:32 PM
#1
Thread Starter
Hyperactive Member
2 Database Questions
1. How can I clear a recordset, Deleting all fields from the recordset?
2. How can i check if a field is exist?
Tnx
-
Jun 3rd, 2003, 02:35 PM
#2
Frenzied Member
are you wanting to delete the values contained in the fields?
or delete the fields from the tables?
what database system are you using?
are you doing this in VB, C++, ASP?
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Jun 3rd, 2003, 02:37 PM
#3
Thread Starter
Hyperactive Member
i'm using VB and Access
I want to delete Values.
What about the second question?
-
Jun 4th, 2003, 07:01 AM
#4
1) Execute the following sql
Delete * from tablename
2)
Open a recordset with
Select * from Tablename
Using error handling (on error resume next) and use the following lines of vbcode:
VB Code:
Dim strTester as string
on error resume next
strtester=rst("fieldname").name
if err.number = 0 then
'field exists
else
err.clear
'field doesn't exist
endif
Tablename is the name of the table
fieldname is the fieldname
Code above assuems rst is the recordset (put the dim in the first few lines and the rest of the code where you need it)
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jun 4th, 2003, 10:11 AM
#5
Frenzied Member
I don't think you need the * in the DELETE statement...
It's tough being an unhandled exception...
___________
VB.NET 2008
VB.NET 2010
ORACLE 11g
CRYSTAL 11
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
|