|
Why do I feel like I bit off more than I can chew for right now?
Wasn't to hard to write my own Stop Watch but I haven't actually programmed since C++ in college and that was in the 2000-2001 school year.
|
|
|
|
|
Erhm, you may be right... Developing a stopwatch requires less experience than a VU meter. You may want to search the web for a codec (filter) which throws events for you which you can catch... Then you'll leave the fancy develoment stuff to someone else ;
|
|
|
|
|
Hi:
I am new to VB. Is it possible to read and write a file as stream in VB.
I am trying to open a file, read 'n' characters from the file and write it to another file. When done, the contents of these files should be same.
Awaiting help !!!!
Thanks in Advance
Praveen
|
|
|
|
|
Yes it is possible..
Google broken where you live?
|
|
|
|
|
Hi. If you're new to VB, your first port of call should be to buy a book and work through it. There's lots to learn before you get to the file system, but any good book would tell you how to work with files in VB, and by the time you got to that part, you'd know how to use the tools well enough to be able to work out this stuff for yourself.
I mean, it's easy enough for me to tell you the line of code that does this, but do you wnat to learn VB, or do you want to post and hope that someone will give you code for every little thing you hope to do ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: I mean, it's easy enough for me to tell you the line of code that does this, but do you wnat to learn VB, or do you want to post and hope that someone will give you code for every little thing you hope to do ?
That's a trick question, right?
|
|
|
|
|
Thanks for the replies, buddies.
I was able to read and write to files.
i tried to read and write to a txt file. I read as a string and when written to the output file, the output is coming in a different line, and each string within double quotes.
I was trying to see if there is any other option to do that ..
|
|
|
|
|
Hi,
can anyone guide me with this cenerio:
Let's say I have four tables:
Case_table(CaseID,date,Type,Desc,etc..)
Case_generator_table(GeneratorID,CaseID,InvestigatorID)
Investigator_table(InvetigatorID,lastname,firstname,function,location,etc..)
user_table(ID,username,password,accesslevel,lastname,firstname,location)
A case can have more than one investigators assigns to it. that's why i have case_generatoe table to maintain x number of investigators.
I have a section for investigation..
I have a form view cases on a grid to load all the cases for that particular section..
since there are more than one cases for that section which can be classified as secret, and also can be assigned to diff investigator.
what i want to accomplish is to allow only access to a specific case to specific investigator on the form view case base on his/her username...
in order word, can investigator can only load/view case assigns to him but a manager can view all the cases
Please guide me on to do that base on the above tables structres..any modification is very welcome and appreciated....
I am using visual studio 2005 and sqlexpress.
Thanks a lot in advance... :
|
|
|
|
|
Using the table structure you have, you can't do what you want. You don't have any information in the table that specifies what access level each item in the database requires in order to see it. It appears that you have a field to specify at what level each user is, but that's not enough to do what you want. You have to assign permissions to each item as to what level of access is required by the user.
|
|
|
|
|
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.
|
|
|
|
|