debasisdas 580 Posting Genius Featured Poster

I mostly take public transport.

debasisdas 580 Posting Genius Featured Poster
  1. accept login credential from UI.
  2. 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.
  3. if it matches (if count = 1 then)proceed further
  4. else re-prompt for credential.
debasisdas 580 Posting Genius Featured Poster

Try the following SQL command.

PURGE RECYCLEBIN;

debasisdas 580 Posting Genius Featured Poster

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 580 Posting Genius Featured Poster

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 580 Posting Genius Featured Poster

You need to write some code to clear the content of the input controls.

debasisdas 580 Posting Genius Featured Poster

Simple,

make the field CashBillNo the primay key of the table.

It will not allow duplicate records.

debasisdas 580 Posting Genius Featured Poster

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 580 Posting Genius Featured Poster

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 580 Posting Genius Featured Poster

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.

AndreRet commented: True, much faster with less errors, thanx debasis +12
debasisdas 580 Posting Genius Featured Poster

tyr this

rs.open "select count(*) as cnt from employee where emp_id='"& txtemplid.text &"'",con,adopendynamic

if count is zero then insert.

debasisdas 580 Posting Genius Featured Poster

You need to store thsoe informations in a separate table and pass the value to the outer query by fetching from inner query.

debasisdas 580 Posting Genius Featured Poster

what is the exact error message ?

debasisdas 580 Posting Genius Featured Poster

at which line ?

have you named all the objects as mentioned in the code .

debasisdas 580 Posting Genius Featured Poster

try the following

cn.Execute("insert into employee values('" & txtempname.text & "'," & txtempid.text & "," & txtssn.text & ") ")

debasisdas 580 Posting Genius Featured Poster

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 580 Posting Genius Featured Poster

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 580 Posting Genius Featured Poster

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 580 Posting Genius Featured Poster

What is the version of MS Access that you are using ?

debasisdas 580 Posting Genius Featured Poster

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 580 Posting Genius Featured Poster

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 580 Posting Genius Featured Poster

At high level you need to implement data lock at record level from DB. It will depend on the DB taht you are working on for exact mechanism to implement. Aslo you need to capture the same from the application and inform the other user who is trying to access the same record.

debasisdas 580 Posting Genius Featured Poster

You need to read this and this.

debasisdas 580 Posting Genius Featured Poster

OutpatientDetails should be a subset of InpatientDetails.

Technically only the patients how have come in can only go out.

You need to maintain the same id in both the tables.

Later if it is required you need to join both the tables based on the ID field for any reporting or any other purpose.

debasisdas 580 Posting Genius Featured Poster

try this

text2.text = list1.list (text1.text)
debasisdas 580 Posting Genius Featured Poster

You need to use filelistbox for the purpose.

debasisdas 580 Posting Genius Featured Poster

What you want to do ?

use either one or all the parameters to filter records ?

debasisdas 580 Posting Genius Featured Poster

try this

Select count(*) from TimeLog where EM_Name = '.................

If it returns 1 display the message else proceed further and save the data.

You need to ensure that EM_Name is the primary key of the table

debasisdas 580 Posting Genius Featured Poster

MySQL is used on most web hosts for the simple reason that it is free.

Can't disagree.

debasisdas 580 Posting Genius Featured Poster

After successful log in, you need to check the privilege of the same user from database. If the user has desired privileges then enable the password change form else disable that.

debasisdas 580 Posting Genius Featured Poster

try to rename the table to something else.

USER is predefined keyword.

debasisdas 580 Posting Genius Featured Poster

How can anyone log in into the database and corrupt the all important data without any access.

Either the data was not important or there was no security for the database. Even if there is some log you will never find the name of the person who did all that.

debasisdas 580 Posting Genius Featured Poster

You need to use a timer.

debasisdas 580 Posting Genius Featured Poster

Have you tried something from your side so far ?

debasisdas 580 Posting Genius Featured Poster

are there duplicate entries for field book_num in the table booking ?

debasisdas 580 Posting Genius Featured Poster

If you already have the code the in which part you are struck with ?

debasisdas 580 Posting Genius Featured Poster

Requirement is not clear.

debasisdas 580 Posting Genius Featured Poster

Write an application that ...........

Who will write ?

debasisdas 580 Posting Genius Featured Poster

You need to take the list of constraints from user_constraints using a cursor and then frame and execute the following script dynamically.

alter table
   table_name
DISABLE constraint
   constraint_name;
debasisdas 580 Posting Genius Featured Poster

You need to increase the buffer.

You need to prepare a dynamic script for the same.

debasisdas 580 Posting Genius Featured Poster

Suppose you select Firstname from your combo box and enter Debasis in the input box .

So the the following line

Adodc1.Recordset.Find  combo1.list (combo1.listindex) & " = '" & dok & "'"

becomes
Step1.

Adodc1.Recordset.Find  Firstname & " = '" & Debasis & "'"

Step2.

Adodc1.Recordset.Find  Firstname = 'Debasis'

So you get the record where Firstname = 'Debasis', simple.
And since script is dynamic it will also work for Lastname = 'Das' and so on.

debasisdas 580 Posting Genius Featured Poster

try this

Adodc1.Recordset.Find & combo1.list (combo1.listindex) & " = '" & dok & "'"
debasisdas 580 Posting Genius Featured Poster

What does the combobox contains ?

debasisdas 580 Posting Genius Featured Poster

only firstname fields will work, the other fields are error. Because of line4 statement..

because you have coded it that way.

you have to select the field names dynamically from combo box at run time.

But in your you have hard coded that to firstname only.

debasisdas 580 Posting Genius Featured Poster

Lets see what you have done so far.

debasisdas 580 Posting Genius Featured Poster

R.I.P.

debasisdas 580 Posting Genius Featured Poster

When data in the source table changes all the dependent views will also change. so you need not try to update the views again.

debasisdas 580 Posting Genius Featured Poster

This may help.

debasisdas 580 Posting Genius Featured Poster

Why are you storing number as characters why not as numbers ?

debasisdas 580 Posting Genius Featured Poster

try this
1. add the column pad to all the views.
2. join the views to select all the desired columns on pad.

without join the record will be a Cartesian product so the number will be huge.