|
jkonduru wrote:
Instead of reading line by line, is it possible specify that file name and send the file to the printer.
No. You're code has to open the file, and read a line, send it, read a line, send it, read a line, read it, ..., until the end of the file. VB6 doesn't do this for you. You have to write the code to do it.
Jkonduru: reply: How will i do this then?
|
|
|
|
|
jkonduru wrote: How will i do this then?
This is basic stuff...
Open "filename" for Input As #1
While Not EOF(1)
Line Input #1, s
' Write the contents of "s" out to printer here...
Wend
Close #1
Google results for "vb6 open file and read[^]".
|
|
|
|
|
Hi:
I would like about if exist a method for change any form from ms access to design view using vba code, the ms access's forms have a context menu with one option called "Change to design view", i want can change to this view from code, is possible?, thanks for your help.
|
|
|
|
|
This question really is geared more towards a forum specifically for supporting Access. This has far more to do with the Access object model than VBA. As far as I can tell, there's no way to switch a form to Desgin view. According to the ViewsAlloed property, it only supports Forms and Datasheet views. There is no option to allow Design view from code.
|
|
|
|
|
Oh, well, thanks for your help
|
|
|
|
|
Does .NET offer a licensing program. I want to use licensing to lock out and unlock my program. Is there a easy way to do this in .Net or will I need a 3rd party software? I searched Google and did not find anything for .Net.
|
|
|
|
|
There is nothing in the .NET BCL to do this, nor should there be. It has to be done either with your own custom implementation or using a 3rd party solution. Either way, it only slows people down from pirating your stuff. Nothing will stop them completely.
Google for "VB.NET licensing" and you'll come up with a bunch of solutions. I hear Aspose has got a good one, though I don't bother with licensing.
|
|
|
|
|
Hi all, Not to sure where I can Find the remoting thread so forgive me for posting under general.
I am currently trying to figure out how remoting works with datasets. Here are the steps taken
1) Created an interface wich will sit on the clients machine and reference the classes
2) Created the implements classes on the server app for the interface
3) Setup the server channels and communication
4) Created a small function that will test the connection
5) Added a database using the designer ... this created an xsd file dataset.
Right ... now everything works fine, the test runs smoothly and the client server talk to eachother. If I create a Dataset with a dataadaptor.fill and the server request the function it works fine and populates a datagrid on the other side.
The Working way.....
Public Function GetData() As System.Data.DataSet Implements IShared.IShared_Interface.GetData<br />
Dim Conn As New OleDbConnection<br />
Dim ConStr As String<br />
ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;"<br />
ConStr += ConnStr<br />
ConStr += "Persist Security Info=True;"<br />
Conn.ConnectionString = ConStr<br />
Dim add As New OleDbDataAdapter("Select * From ClientInfo", Conn)<br />
Dim Dt As New DataTable<br />
add.Fill(Dt)<br />
Dim Ds As New DataSet<br />
Ds.Tables.Add(Dt)<br />
Return Ds<br />
End Function
I hoped that there was a better way to do this then started experimenting, hence step 5.
The designer sets up the database, datasets, dataadapters all nicely in the xsd file, but ... when the client request the dataset it has an incorrect assembly
Unable to find assembly 'AssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
The Not Working way ....
Public Function GetDataAnotherWay() As System.Data.DataSet Implements IRMSShared.IRMSShared_Interface.GetDataAnotherWay<br />
Dim Ds As New DataBaseDataSet<br />
Return Ds<br />
End Function
Please could someone help me out here, I would think that the second example would be much easier but it is not. I have look at the seialization techniques, but seems like a very long way round ... might as well just code all the datasets and dataadaptors.
If any one knows a link to examples of how to use a Typed Dataset in remoting through an interface please let me know. I have been battling at this for some time. I will even email the full source code. It is written with vs 2008 beta 2, but I am using the framwork 2.
Thanks
Go Springboks
-- modified at 14:33 Tuesday 23rd October, 2007
|
|
|
|
|
I haven't used 2008 very much, and surely not doing any remoting with datasets, but...
In your first example, you're returning a DataSetObject, in the second sample, you're returning an Object. I also don't have any clue what a "DataBaseDataSet" object is, so there's no way to tell what it's implementation is or if it supports serialzation, ...
|
|
|
|
|
Hi Dave
Apologies for the crappy code in the second function, I was testing to see what type of object is actually created. The object is meant to be a datasetobject.
DataBaseDataSet a class of the Typed Dataset that the designer creates when the database is added to the project, it could be any name. It has the same name as the xsd file which references the database.
VS 2008 is pretty cool and look forward to it's launch. The reason for 2008 is I upgraded to Vista and VS 2003 does not run on that, which I used to code in. Wasn't going to purchase vs 2005 if 2008 is replacing it in a few months. Things are expensive here in good SA.
I see that you have not remoted datasets in your apps, have you created some apps that use data on a client machine. Is there another way around this.
Thanks for the response
|
|
|
|
|
RG_SA wrote: I see that you have not remoted datasets in your apps
No, I said I haven't done it under all the designer generated crap of VS2008. I normally don't use the designer generated stuff...
I HAVE remoted DataSet's with my own code under 2005. Since a DS is easily serializable under XML, there's no problem. An instance of an Object is not serializable, even if it's a wrapper for a serializable object. If the function returned an object that inherited from DataSet, it shouldn't be an issue.
OK. The original post changed. The error you're getting is probably caused by the interface definition not being found. Is the assembly that defines the interface in the folder from where the server .EXE was launched?? Are you returning an implementation of that interface?? Is the assembly for that definition in the server .EXE's folder?? Do the assembly version numbers match what the server .EXE was compiled against?? That's usually what causes the error you're getting.
-- modified at 15:34 Tuesday 23rd October, 2007
|
|
|
|
|
I have a TCP/IP server (VB .net 2.0 Windows App) that accepts connections from clients receives a string from them and passes back an answer. The TCP/IP Server creates a thread for each connection and that thread handles that connection then terminates. Each of these connection threads increments a counter class when it starts and decrements it when it finishes. The main thread in the TCP/IP server program queries the value of the counter class periodically to see how many threads are being handled at that time. This is working perfectly and has been for well over a year.
Now, I need to share the value of this counter with other programs. In specific we are going to start using Microsoft's System Center Manager to monitor and alert of potential problems etc. After a discussion with my Boss it is clear that he would like a way to reach into my program and pull this value vs. having my program write it to an environment variable or even a file that could be read. I think this should be doable but I'm not sure exactly what I should be looking to do. Keep in mind the TCP/IP server is a Windows App. Any advise would be appreciated.
|
|
|
|
|
There's a bunch of different ways of doing this, depending on your environment. Probably the best way to do it is to change the server code to expose the number you were talking about as a PerformanceCounter. Other programs can then use the performance counter information to get the current count.
An Introduction To Performance Counters[^]. The code is in C#, but is easily translatable to VB.NET.
|
|
|
|
|
Is the performance counter the same thing as WMI?
|
|
|
|
|
Nope. But WMI has it's option too, where you're able to create a custom class to do this. It's more work than creating a PerformanceCounter implementation though.
|
|
|
|
|
Ok, I just spoke with my boss and he's still deciding on what monitoring package to use so I kind of need to wait until I see what it is capable of reading now. I appreciate all your help.
|
|
|
|
|
hi frnds,
i am using Visual basic DOM
my XML is like
<study>
<subject id="1">
<sub-topic> fast </sub-topic>
</subject>
<subject id="2">
<sub-topic> fast1 </sub-topic>
</subject>
</study>
i have to remove all the <sub-topic> node and insert them before the
<subject id="1"> tag
i have do the code...But can't supported pl...show me the way
here is my code
[CODE]
oNodeStudyList = objdom.getElementByTagName("study")
oNodeList = objdom.getElementByTagName("subject")
dim i as integer
dim iCount as integer
for iCount = 0 to oNodeStudyList.Length -1
for i = 0 to oNodeList.length -1
Set oNode = oNodeList(i)
if oNode.haschildnodes then
Set oDemoNode = Node.InsertBefore(node.childnode(0),oNodeStudyList.childnode(0))
end if
next
next
[/CODE]
first <sub-topic> will be added successfully
but then it can't find the second the <sub-topic>
where i am wrong....?
please help...
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
koolprasad2003 wrote: Set oDemoNode = Node.InsertBefore(node.childnode(0),oNodeStudyList.childnode(0))
Is this a typo? You haven't defined a variable called node .
Paul Marfleet
|
|
|
|
|
yes i defined it already...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Well it's not mentioned in the code you posted. I thought you said you had posted all your code?
Paul Marfleet
|
|
|
|
|
I'm doing industrial experience in my course, building a VB.Net based program, but my client is using Mac OS X 10.4.3, which VB.Net can't work on. I heard Mono framework helps, but I don't know exactly how to do it. Could anyone here please help me? Thank You.
|
|
|
|
|
alurora wrote: but my client is using Mac OS X 10.4.3, which VB.Net can't work on.
VB.NET doesn't have to work on the target client. It only have to be capable of running .NET applications, which Mono (among other things) can provide.
Have a look at the Mono FAQ[^], that should answer most questions that you might have.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Thank You. But I've read those FAQ and they didn't provide any clue how to do it. I can't even find the Mono Visual Basic Compiler and Visual Basic Runtime, their instruction isn't clear. Could you or anyone else help me, please?
|
|
|
|
|
i am using .net 2005.i do my project in vb.net.i want to enable only past dates and today date.so i want to disable future dates in calander.i want in windows application not web application.
|
|
|
|
|
I believe the date time picker control allows you to specify a range of dates that can be selected. If not, you can check when the selection is made and reject it. Use DateTime.Now.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|