|
Set localConnection = CurrentDb()
Set rJN = localConnection.OpenRecordset("TEST")
rJN.MoveLast
dim dtRS as Date = rJN![Test]
If dtRS.Month = Now.Month Then
dtRS.Month = dtRS.Month + 1
Else
dtRS.Month = "01"
End If
debug.writeline (dtRS.ToString)
Have not tested this...but may be this is what u want...
Regards,
NetPointer
|
|
|
|
|
How do one restore/refresh a database connection in code, without exitting?
|
|
|
|
|
Hi all VB gurus, anyway to print a microsoft access 2000 report from a VB app? I'm using an ADO Connection interface at the minute, but I'm guessing I'll having to use another component? Thanks all who give it a go.
|
|
|
|
|
...to find the current transperancy level of the windows' taskbar. I have a function to set a specific transperancy level though the windows API, but how can I get a value of an existig, or should I say current transperancy level?
any help would be greatly appreciated.
|
|
|
|
|
Hi...
Nice to hear from u all
By the way, I'm trying to do a program to control printing.
The scenario:
I have 1 mass volume printer and 1 normal printer. The system would be able to detect the number of copies that I send and automatically assign to the correct printer. Less than 25 copies go to normal printer, and more than 25 copies go to mass volume printer.
How should I start to do this program?
What languages would be appropriate to program it ?
Please help me, I'm just a starter in programming field.
Your help would be very useful for me, and I'm very grateful to hear from u all....
thanks
regards,
wism chan
|
|
|
|
|
I have a calendar in web application vb.net.
I have a month dropdown box, a day dropdownbox and a year dropdown box.
When I select the Month, I can get my calendar to change to month but right now
have hard code at end for /1/2003. How do I get it to change for month and stay on
whatever day and year.
And then select the day I want in the dropdown box and change the day in calendar but
keep the month i just selected and year shown.
And then select the Year I want in the dropdown box and change the year in calendar
but keep month and day I just selected in other dropdown boxes?
Can't figure it out.
This is my dropdown list so for for the Month which works , but then I need it to stay
on the selected month and change for day, year. Can't figure out without hard code
at end "/1/2003" which I don't want, because day and year dropdown lists when selected
need to change for whatever I select.
PLEASE HELP!!!!! Thank you.... Alex
Private Sub ddlMonth_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlMonth.SelectedIndexChanged
'ddlMonth.DataValueField = Calendar1.SelectedDate.Month
Calendar1.SelectedDate = CDate(ddlMonth.SelectedIndex + 1 & "/1/2003")
Calendar1.VisibleDate = CDate(ddlMonth.SelectedIndex + 1 & "/1/2003")
End Sub
|
|
|
|
|
I have some Crystal Reports that I am using in my VB6 application that I would like to convert to .net and was wondering if I could somehow use my old reports in .Net ?
ALso, can I use my reports in the version of Crystal Reports that comes with .net or would I have to buy a package ? Which isn't goint to happen soon due to my unemployment, which is why I a asking.
Thanks
Tony
|
|
|
|
|
Hi,
I have a problem parsing a WSDL xml with an XMlDocument.
This is a short version of the XML:
<?xml version="1.0" encoding="utf-8" ?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org/WebReferenceAddin.DefaultCustomer/CustomerEngine" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/WebReferenceAddin.DefaultCustomer/CustomerEngine" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types />
<message name="GetCustomerSoapIn" />
<message name="GetCustomerSoapOut" />
<message name="GetCustomerByNameSoapIn" />
<message name="GetCustomerByNameSoapOut" />
<portType name="CustomerEngineSoap" />
<binding name="CustomerEngineSoap" type="s0:CustomerEngineSoap" />
<service name="CustomerEngine">
<port name="CustomerEngineSoap" binding="s0:CustomerEngineSoap">
<soap:address location="http://localhost/webreferenceaddin.defaultcustomer/customerengine.asmx" />
</port>
</service>
</definitions>
The code I use is:
Dim dom As New System.Xml.XmlDocument
dom.Load(URL.Text)
'Create an XmlNamespaceManager for resolving namespaces.
Dim nsmgr As System.Xml.XmlNamespaceManager = _
New System.Xml.XmlNamespaceManager(dom.NameTable)
For Each att As System.Xml.XmlAttribute In dom.DocumentElement.Attributes
If att.Prefix = "xmlns" Then
nsmgr.AddNamespace(att.LocalName, att.Value)
End If
If att.LocalName = "xmlns" Then
nsmgr.AddNamespace("", att.Value)
End If
Next
When I use the commandwindow for selecting the service element I get:
>? dom.selectsinglenode("./node()[1]/service",nsmgr)
Nothing
But the statement below gives
>? dom.selectsinglenode("./node()[1]/node()[8]",nsmgr)
{System.Xml.XmlElement}
[System.Xml.XmlElement]: {System.Xml.XmlElement}
Attributes: {System.Xml.XmlAttributeCollection}
BaseURI: "http://localhost/webreferenceaddin.defaultcustomer/customerengine.asmx?wsdl"
ChildNodes: {System.Xml.XmlChildNodes}
FirstChild: {System.Xml.XmlElement}
HasChildNodes: True
InnerText: ""
InnerXml: "<port name="CustomerEngineSoap" binding="s0:CustomerEngineSoap" xmlns="http://schemas.xmlsoap.org/wsdl/"><soap:address location="http://localhost/webreferenceaddin.defaultcustomer/customerengine.asmx" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" /></port>"
IsReadOnly: False
Item: <cannot view indexed property>
LastChild: {System.Xml.XmlElement}
LocalName: "service"
Name: "service"
NamespaceURI: "http://schemas.xmlsoap.org/wsdl/"
NextSibling: Nothing
NodeType: Element
OuterXml: "<service name="CustomerEngine" xmlns="http://schemas.xmlsoap.org/wsdl/"><port name="CustomerEngineSoap" binding="s0:CustomerEngineSoap"><soap:address location="http://localhost/webreferenceaddin.defaultcustomer/customerengine.asmx" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" /></port></service>"
OwnerDocument: {System.Xml.XmlDocument}
ParentNode: {System.Xml.XmlElement}
Prefix: ""
PreviousSibling: {System.Xml.XmlElement}
Value: Nothing
What is wrong?
Thank you,
Raf.
|
|
|
|
|
Hi Raf!
You could use following XPath query:
node()[1]/*[name()='service']
For a good overview of all XPath possiblities (including interactive testing!), visit http://www.zvon.org/xxl/XPathTutorial/General/examples.html. To do some more interactive testing you can use the XPath Visualizer Version 1.4 (http://www.vbxml.com/xpathvisualizer/default.asp).
Greetz
Jan
|
|
|
|
|
Thank you for the solution.
It works. I will check the site later this week.
Raf.
|
|
|
|
|
We make extensive use of Datagrids in our project but a lot of the data displayed in the grid is either to big for the specific column or the column is to big for the data.
Can ANYONE tell me how to resize only certain columns in the datagrid????
|
|
|
|
|
Hi!
I've also tried this and went crazy doing so... I don't think it's possible.
My advice is to use a ListView Control. You can't use Databinding then, but you can resize your columns to whatever size you want....
If anyone knows how to resize the datagrid columns, i'd like to know how to do it, too!
Sorry I couldn't give you better advice...
-Timo
|
|
|
|
|
Heres how I arrive at my dilema (a very simplified example):
1. Create a new Window Application Solution.
2. Add to the project a new user control, lets call it UserControl1
3. Add 1 panel to UserControl1, lets call it Panel1. Dock it to the right and size it such that it takes up half of the available real estate.
4. On the main form for the application, place an instance (from the toolbox) of UserControl1 anywhere you like.
5. Now place a button in the panel of UserControl1.
Step 5 seems impossible. I would like to create a control type whose purpose is to contain other controls (and other things). But everytime I try and place this control in the Panel, it appears behind the panel. The container for the button is always UserControl1 not Panel1. How can I make the container for the newly placed button be Panel1 and not UserControl1? (Using typical Design View method (drag and drop).
Thanks for your time...
|
|
|
|
|
declare AddForm Lib "winspool.drv" Alias "AddFormA" _
(ByVal hPrinter As Long, ByVal level As Long, pForm As Byte) As Long
Who can give sample code
|
|
|
|
|
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B282474
|
|
|
|
|
That is in vb6.0.But now i use in vb.net.It can't work.
The reason is API Function CpoyMemory and AddForm can't use in VB.net.
|
|
|
|
|
Hi... I need help terribly... I'm using Visual Basic .NET.
As my subject, is there any way to convert Microsoft Words/Excel into an image programatically? Or is there any 3rd party component which allows me to manipulate the conversion programatically in my application? I wanna perform wat the Tablet PC Journal Writer can do, i.e. export the word .doc into an image and allows me to "ink" on it.
I would need VB.NET snipplets to understand.
Thank you..
|
|
|
|
|
I would look into opening the document using the Office Object Model and then seeing what formats are available to "save as" that document in.
|
|
|
|
|
I need to marshal a structure so that I can pass it to a C++ DLL and
vice versa. The following works correctly:
<structlayout(layoutkind.sequential)> _
Private Structure PLCDATA
<marshalas(unmanagedtype.i4)> Dim w1 As Int32
<marshalas(unmanagedtype.i4)> Dim w2 As Int32
<marshalas(unmanagedtype.i4)> Dim w3 As Int32
<marshalas(unmanagedtype.variantbool)> Dim b1 As Boolean
<marshalas(unmanagedtype.variantbool)> Dim b2 As Boolean
<marshalas(unmanagedtype.byvalarray, sizeconst:="5)"> Dim Arr() As Int32
Sub initialize()
ReDim Arr(4)
End Sub
End Structure
Now I need to have another item in the structure be an array of a
different structure. Hope that makes since. I thought this would
work but it gives me an error:
<structlayout(layoutkind.sequential)> _
Private Structure PARCEL
<marshalas(unmanagedtype.i4)> Dim Induct As Int32
<marshalas(unmanagedtype.i4)> Dim Dest As Int32
<marshalas(unmanagedtype.i4)> Dim Reason As Int32
End Structure
<structlayout(layoutkind.sequential)> _
Private Structure PLCDATA
<marshalas(unmanagedtype.i4)> Dim w1 As Int32
<marshalas(unmanagedtype.i4)> Dim w2 As Int32
<marshalas(unmanagedtype.i4)> Dim w3 As Int32
<marshalas(unmanagedtype.variantbool)> Dim b1 As Boolean
<marshalas(unmanagedtype.variantbool)> Dim b2 As Boolean
<marshalas(unmanagedtype.byvalarray, sizeconst:="5)"> Dim Arr() As Int32
<marshalas(unmanagedtype.byvalarray, arraysubtype:="UnmanagedType.Struct," sizeconst:="3)"> Dim Items() As PARCEL
Sub initialize()
ReDim Arr(4)
ReDim Items(2)
End Sub
End Structure
The error I get looks like this:
System.TypeLoadException: Can not marshal field Items of type PLCDATA:
This type can not be marshaled as a structure field.
at Test_PLCData.Form1.ReadFromPLC(PLCDATA& pRead)
at Test_PLCData.Form1.Button1_Click(Object sender, EventArgs e) in
C:\Esanti Code\C++\PLC_Data DLL\VB.NET Test App\Test PLCData\Test
PLCData\Form1.vb:line 106
Can anyone tell me how to get this to work correctly? Thanks in
advance!!!
|
|
|
|
|
I m writing the C# version up here. try with similar in yor code.
// The Person structure
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
public struct Person {
public string firstName;
public string lastName;
}
// The Bank account structure. Note the use of an IntPtr
// to hold the pointer to the account holder
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
public struct Account {
public IntPtr accountHolder; //I m using Intptr not Person.
public string accountName;
public long accountNumber;
public double balance;
}
|
|
|
|
|
If you wanted a fixed array size of the Person structure how would you do it?
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
public struct s1
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst=16)]
public long[] vals;
}
Is this u want???
|
|
|
|
|
No, I need an array of a structure inside another structure.
StructLayout(LayoutKind.Sequential)]
public struct s1
{
[MarshalAs(UnmanagedType.I4)]
public int val;
}
StructLayout(LayoutKind.Sequential)]
public struct s2
{
[MarshalAs(UnmanagedType.Struct, SizeConst=16)]
public s1[] vals;
}
Something like that. Take a look at my original post.
|
|
|
|
|
I'm a vb.net noob who needs some help. Is there a way to get the size of a specified folder? I'm using this code to get all sub-directories of a specified folder and would like to also retrive the folder size of each.
Dim myPath As String = "C:\test"
Dim myDirectory As System.IO.Directory
Dim mySubDirectory As String
Dim myDirectorySize As String
If myDirectory.Exists(myPath) Then
For Each mySubDirectory In myDirectory.GetDirectories(myPath)
MsgBox(mySubDirectory)
Next
End If
Any ideas?
|
|
|
|
|
Private Function DirectoryList(ByVal Name As String) As Int64
Dim Folder As New DirectoryInfo(Name)
Dim SubFolder As DirectoryInfo
Dim File As FileInfo
Dim Size As Int64 = 0
'Get the size of all files in folder
For Each File In Folder.GetFiles()
Size += Files.Length
Next
'Get the size of all subfolders in folder
For Each SubFolder In Folder.GetDirectories()
Size += DirectoryList(SubFolders.FullName)
Next
MsgBox(Name & " containes " & Size & " bytes")
Return Size
End Function
|
|
|
|