- accept login credential from UI.
- check the same in the DB. (select count(*) from user_table where user_id = "user_id" and password = "password" ). ensure user_id is unique/priamy key.
- if it matches (if count = 1 then)proceed further
- else re-prompt for credential.
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
Try the following SQL command.
PURGE RECYCLEBIN;
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
Here is a completely different approach, the code is in form of a Oracle procedure . You need to call the Oracle procedure in VB to achieve the same.
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
You need to polulate the controls from the recordset before closing it. Of course you have to check for BOF and EOF.
something like this.
If rsSearch.EOF <> True And rsSearch.BOF <> True Then
Text1.Text = rsSearch.Fields(0)
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
You need to write some code to clear the content of the input controls.
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
Simple,
make the field CashBillNo the primay key of the table.
It will not allow duplicate records.
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
Ok, got it.
But i also have a question.
Say you have 3 records like this
OrderFormNo=345 and CashBillNo='ABC'
OrderFormNo=123 and CashBillNo='ABC'
OrderFormNo=234 and CashBillNo='ABC'
Which one to delete.
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
when i say parallel insert , what i mean to say is you need to execute 2 insert statments
1. into the table5
2. into the table4
by using the same input values.
and if you try to use sub queries for insert into table4 and execute the code for each new record, a lot of duplicate records will be inserted into table4 because of repeated select of old data from table5.
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
What about running parallel insert into both the underlying tables. So each time there is a new entry into table5 the same is also inserted into table4 for desired fields.
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
tyr this
rs.open "select count(*) as cnt from employee where emp_id='"& txtemplid.text &"'",con,adopendynamic
if count is zero then insert.
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
You need to store thsoe informations in a separate table and pass the value to the outer query by fetching from inner query.
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
what is the exact error message ?
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
at which line ?
have you named all the objects as mentioned in the code .
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
try the following
cn.Execute("insert into employee values('" & txtempname.text & "'," & txtempid.text & "," & txtssn.text & ") ")
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
Do you have password for SYSTEM or any other account with DBA roles ? If that is the case you can alter password of SYS and login with new password. without that you can't retrieve the password and can't login.
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
and again as i have said earlier, you have tried to copy and paste controls and that resulted in creating a control array of controls (for option buttons) . I am not sure if you have done the same for textboxes also.
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
then it should have been
a = textbox1
not the other way around.
and it should have been placed just below the declaration of a the variable.
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
What is the version of MS Access that you are using ?
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
What is the initial value of a ?
and the screen shot suggests you have created control arrray of Option button.
so tehnically there is no control named Option1, Option2 and Option3
what you have is Option1(1),Option1(2),Option1(3)
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
What if i am partially color blind and red appears maroon or saffron to me. Does this concept of typing the name of the color in the code work ?
Just a thought, though. :)
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20