|
Hi,
Thanks for replying.
On the user_table(ID, username,password, Access_level, lastname, firstname,etc..)
the access_level permits the user to access to particular form..
if access_level is invetigator, then this user can load the investigative form.
here lies my problem when the investigator goes to his section. How can i limit access to his case only.
Let's say case#A098901 assigns to both john and peter
and case#A098902 assign to peter..
when john logs in, he should only be able to see case#A098901
but a manager can see both cases..
I was thinking having a column name (username) on the case_generator_table and inner join case_table with case_generator_table.
I am not so sure of that..any of your suggestion is welcome..if needed to change table structures,that i will do..
Thanks again
|
|
|
|
|
At some point you need to have a link between user and investigator... the simplest way would be for the UserID to be included in the Investigator table (making Investigator basically a special kind of user).
When you open the case form, simply have a check similar to this pseudo code:
if USER IS MANAGER then
select all items from case table joined to investigator and user tables (to get the rest of the details)
else if USER IS INVESTIGATOR then
select items from case table joined to investigator and user tables (to get the rest of the details)
where USERID = LOGGED IN USERID
else
put code to handle the default situation here
end if
|
|
|
|
|
Hi All,
I have created one column sql database with datatype float. In VB, i declared Dim Pay As Double.
Do I need to convert this "Pay" values into float datatype before writing into the database column? because i am trying to update the column, but its not updating?
Is it a problem of datatype mismatch? How to handle this?
Thanks.
|
|
|
|
|
That conversion I don't think will matter. The best thing to do is put a Watch window on the SQL string you are pass in i.e UPDATE * from tblBlah Where Blah=22.55. Copy that and paste it directly into a SQL query and see what errors you get.
|
|
|
|
|
I did this, it is updating .. but if update Pay = A + B, where A,B are Double and Pay is float, then it is not getting updated.
|
|
|
|
|
Without seeing your code (including the SQL statement) that you're running, it's nearly impossible to know what your problem is.
|
|
|
|
|
I am trying to use a com object in VB.NET (Visual Studio 2005). One of the input parameter of a com mehtod is of type Variant. I tried to pass an Object, it does not work (type mismatch).
What type should I use as the input paramter? How to get around this problem? Thank.
|
|
|
|
|
You need to decorate the parameter definition with the MarshalAs(UnmanagedType.Struct) attribute which is found in the System.Runtime.InteropServices namepsace. eg.
<DllImport("user32.dll")> _
Public Shared Function myFunction(<MarshalAs(UnmanagedType.Struct)>ByRef lpRect As Object) As Boolean
End Function
[Edit] Sorry, just noticed that the pre tags mangled my formatting and confused my attribute tags with html tags. Should make more sense now.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
modified on Wednesday, November 11, 2009 5:57 PM
|
|
|
|
|
Thanks. The information you provided is very helpful, although I do not have to use "VARIANT" for this project after all, because there is another method in the com object that can do the same thing without "VARIANT".
|
|
|
|
|
Hi,
I have VB project with Access Database
but when i use update statement with no errors but no changes occured in the database.
connection string statement is
"Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=App_Data\TrainingDept.mdb" & _
";Persist Security Info=True"
why?
|
|
|
|
|
|
yes.Where clause is correct and when i wrote update statement
on the access database, the data will be updated but the problem is the update statement in the vb code
|
|
|
|
|
What you posted looks ok, but its hard to tell just by that. The only thing i can offer with what you posted is if you are using 64 bit what you have won't work. ACE isn't supported in 64 bit.
Post the entire statement or better yet look into TableAdapters.
|
|
|
|
|
If you have your Access database in your project, it is possible that every time you compile and run the app, the database being used (in the Debug folder or your project) is being overwritten by the master copy of the database in the project. Any changes you make during one run of your program will be lost the next time you run the app from Visual Studio.
Now, if you're looking for changes that were supposed to have been made in one run of the application and you're not seeing them, the possible problems expand to either an incorrect WHERE clause in the SQL (it doesn't find the record(s) to change), or you're not looking at the correct copy of the database for the changes.
|
|
|
|
|
Do a SELECT with your UPDATE statement's WHERE clause and you should see the reason why your table is not updated.
|
|
|
|
|
|
|
Hi there,
I have the following code which takes data from SQL and then adds it to a Excel Spreadsheet.
This all works fine, but I need to subtract the column "K" from Column "L" and store it in "M"
It inserts the formula into the required number of rows (dependant of the value "R2") but the formula shows as =(K & D1)-(L & D1) in each cell and not for example =(K 28)-(L 28) etc....
Can you help??
Thanks
<code>
Dim SQlQuery2 As String = "select * from growth where Name <> '[Files]'order by FullPath"
Dim SQLCommand2 As New SqlCommand(SQlQuery2, myConn)
Dim SQlReader2 As SqlDataReader = SQLCommand2.ExecuteReader
Dim R2 As Integer = 27
While SQlReader2.Read
R2 = R2 + 1
osheet.Range("I" & R2).Value = SQlReader2.GetValue(0).ToString
osheet.Range("I" & R2).BorderAround(8)
osheet.Range("J" & R2).Value = SQlReader2.GetValue(1).ToString
osheet.Range("J" & R2).BorderAround(8)
osheet.Range("K" & R2).Value = SQlReader2.GetValue(2).ToString
osheet.Range("K" & R2).BorderAround(8)
osheet.Range("L" & R2).Value = SQlReader2.GetValue(3).ToString
osheet.Range("L" & R2).BorderAround(8)
End While
SQlReader2.Close()
SQlReader2 = Nothing
Dim D1 As Integer = 28
Do Until D1 = R2
osheet.Range("M" & D1).Formula = "=(""K"" & D1)-(""L"" & D1)"
D1 = D1 + 1
Loop
</code>
|
|
|
|
|
The below works, you just have to build the string, yours is a common issue. Everything in the formula should be in parenthesis, then go back and replace all numbers with " & D1 & "
osheet.Range("M" & D1).Formula = "=(K" & D1 & ")-(L" & D1 & ")"
|
|
|
|
|
Hi there,
Thats great, working fine now...
Ta v much.....
|
|
|
|
|
Good Day All
I created 2 batch files to run a command line program...the first runs the actual program and accepts in a parameter, and the second batch file runs the first batch file with the parameters I give it.
I now need to get some information from this process, the first is the time taken to complete the process, and the second is to get the memory used.
I am trying to create a VB console application (not sure if on the right track) to run the executable, the same way I did in the batch files (sending parameters to a command line program).
Getting the time taken is no problem. my problem is getting the VB console to call the executable (not sure how to do that), and the other problem is getting the amount of memory used running the VB program.
The memory used, is not so important at this point (I can work on that later). I would like to know if anyone could help me with running the executable within my newly created program.
Thanks in advance!
|
|
|
|
|
Look into the Process class (Process.Start("SomeApplication.exe") , Process.HasExited , Process.ExitTime , etc) to launch the app you want to monitor.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thanks for the assistance. The first bit helped, now I just have to look into it in more depth to extract some further information from the process.
Thanks again!
|
|
|
|
|
Have a look at System.Diagnostics.Process class.
|
|
|
|
|
I will look into this. Thanks!
|
|
|
|