|
Hi I want to access the windows address book and display the info of contacts in vb. can anyone plz help me
sajeed
|
|
|
|
|
Hello, I am working on a program for my workplace that requires sending information from a Form to an excel spreadsheet that is shared to certain users. I can create a spreadsheet through VB but I am not sure how to add to it. I would typically use Access but that is not available at my workplace. This is a scheduling application and gets added to on a daily basis so the program would have to determine the next empty cell in excel on its own. Is this possible? Any suggestions? My experience level is beginner-ish.
|
|
|
|
|
I am trying to develop a user page, where I show the number of days taken for a task completion using a text control. In the background (i.e., the text should be in the front) I need a control (something like a grid) which can show the weeks or days (timescale) in vertical columns. Which control should I use and how? Any help in this regard will be greatly appreciated.
|
|
|
|
|
How do you create a string with 3 substrings to validate a telephone number. I know I can use the MaskEdit tool but I can't in this program. I have to use the IsNumeric function to determine is the textbox has the correct data. The telephone number is in the format of 999-999-9999, where 9 is represented by any number. I have to create 3 substrings for each part of the number. Also when I click on my button to exe the IsNumeric function I get my error message I created "Please enter a numeric value" because the dashes are not a number, how do I stop the error message without removing the IsNumeric function. HELP PLEASE ASAP
Thanks in advance
|
|
|
|
|
myString.Split('-')
will return an array of strings. In the case of a valid phone number it will be three strings. You can then do your IsNumeric test on each of the three strings.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
How do you create the string and substrings for a valid entry?
|
|
|
|
|
This is the code I have but I'm not getting the output correct. What am I doing wrong?
Dim MyString As String
Dim intLen As Integer
MyString = (999 - 999 - 9999)
MyString.Substring(0, 2)
MyString.Substring(4, 6)
MyString.Substring(8, 11)
intLen = Len(MyString)
If IsNumeric(MyString.Substring(0, 2)) = False Then
txtTel.Text = Nothing
txtTel.Focus()
MsgBox("Please enter a numeric value")
End If
If IsNumeric(MyString.Substring(4, 6)) = False Then
txtTel.Text = Nothing
txtTel.Focus()
MsgBox("Please enter a numeric value")
End If
If IsNumeric(MyString.Substring(8, 11)) = False Then
txtTel.Text = Nothing
txtTel.Focus()
MsgBox("Please enter a numeric value")
End If
What am I not doing right?
|
|
|
|
|
justmeTW wrote:
I'm not getting the output correct. What am I doing wrong?
What output are you getting?
justmeTW wrote:
MyString = (999 - 999 - 9999)
I'm guessing that the quotes are missing here, but are actually there in the real code.
justmeTW wrote:
MyString.Substring(0, 2)
MyString.Substring(4, 6)
MyString.Substring(8, 11)
This doesn't do anything useful. It wastes processor time because the substring operation is carried out, but the result is thrown away as you don't assign it to any variable.
I'm assuming that Substring() takes the start and end index. I'm also assuming that IsNumeric() takes a string and not an individual character. Can you confirm these assumptions?
justmeTW wrote:
txtTel.Text = Nothing
txtTel.Focus()
If the user gets it wrong, by all means, focus on the control, but don't delete the text - What if the user just mistyped one character? Do they want to have to type it all in again, or just correct the erroneous character?
These should help debug your code.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
String handling is one of the most basic parts of programming. Either you need more time to learn the basics i.e. sit down with a book that will take you step-by-step through each basic aspect of programming.
Or, if do know how to program already, then you need to phrase your question better because I have no idea what you mean.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
I'm in a Programming class that is suppose to be step-by-step, but it's not, that is why I am having so much difficulty.
Colin wrote:What output are you getting?
When I type in a letter char I'm suppose to get a error message, if I just use the following code it works:
If IsNumeric(txtTel.Text) = False then
txtTel.Text = Nothing
txtTel.Focus
msgbox("Please enter a numeric value")
end if
Is works as long as I don't have the dashes in the text box. What my assignment calls for is to create a string for the phone number 999-999-9999 then create 3 substrings for each part of the orginal string (999-999-9999). The first substring should be "999", second substring "999" and third substring "9999" but my book doesnt explain how to create the substrings. I have search throught the VB help and every other resource I have found, but still don't understand how to create the substrings and then use them for the IsNumeric function.
Colin wrote: If the user gets it wrong, by all means, focus on the control, but don't delete the text - What if the user just mistyped one character? Do they want to have to type it all in again, or just correct the erroneous character.
If the input is not valid I am to clear the textbox and set focus back to it and have then re-enter the phone number. That is why I did it that way, it's part of the assignment. I know there is a way to have the error part to be selected instead of the whole thing but right now I am just trying to get the required part done and understand how to do it. My main problem is with creating the substrings and how to get the IsNumeric function to skip the dashes and only read the numbers.
|
|
|
|
|
Colin wrote: If the user gets it wrong, by all means, focus on the control, but don't delete the text - What if the user just mistyped one character? Do they want to have to type it all in again, or just correct the erroneous character.
If the input is not valid I am to clear the textbox and set focus back to it and have then re-enter the phone number. That is why I did it that way, it's part of the assignment. I know there is a way to have the error part to be selected instead of the whole thing but right now I am just trying to get the required part done and understand how to do it. My main problem is with creating the substrings and how to get the IsNumeric function to skip the dashes and only read the numbers.
I forgot to add that it only clears the box if the txtTel.Text is a letter char, if it is a number is won't clear it.
|
|
|
|
|
language : visual basic .net
overview : TreeView control is composed by nodes collection which is the TreeNode object. every TreeNode object have some property(ex: Tag Property). these property can be use in the tree view event like Treeview_AfterSelect event(ex: e.node.tag)
Wanted : make the second Tag property.
i have already try to make a class which inherits from the treenode class and add a property (say : Tag2 property) but when i use the Treeview_afterSelect event, i can't find my Tag2 property using the e.node.(property).
i assume this is because the e variable in this event is define as System.Windows.Forms.TreeViewEventArgs (as indicated in the event declaration : Private Sub TV_AfterSelect(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TV.AfterSelect) which don't have the Tag2 property
Question : how can i make the tag2 property which can be accessed in the TreeView Events just like the Tag property does.
(please give the detail step by step)
Thanks.
|
|
|
|
|
You need to cast thee treenode object that comes in e.node to your object.
e.g.
Dim vExtendedNode as MyNode
vExtendedNode=CType(e.node,MyNode)
Hope this helps...
Free your mind...
|
|
|
|
|
I'm wondering if there's an escape character for " when using it as below?
getFieldValues = Replace(getFieldValues, """, "'")
I'm looking to replace all "'s in a string so that I can copy and paste it directly into query analyser as a SQL string.
Thanks
Look at the world about you and trust to your own convictions. - Ansel Adams
Meg's World - Blog
Photography - The product of my passion
|
|
|
|
|
The proper format is to double the quotes, e.g.:
getFieldValues = Replace(getFieldValues, """", "'")
denimined
|
|
|
|
|
Hi Folks
A simple project is done to use access database from visual basic.. While the program works perfectly. Then it is packaged and sent for distribution (using package an deployment tool of vb). At the client's place while doing the setup it is giving the following error(s).
Can somebody help me out please
Database : Access
Front End: VB 6.0
OS: Win-XP (Home edition)
*** ERROR: The file 'C:\DOCUME~1\ADMINI~1.NII\LOCALS~1\Temp\msftqws.pdw\$(DLLSelfRegisterEx)' could not be registered because it was not found.
*** ERROR: (User Responded with 'OK')
Thanks in advance
Sam
Sampath K.S
Bangkok
|
|
|
|
|
Wat os ur using..
Shanmuga Sundar.V
|
|
|
|
|
He already told us: "OS: Win-XP (Home Edition)"
|
|
|
|
|
Windows XP
Sampath K.S
Bangkok
|
|
|
|
|
Hello Everyone~~
I got a problem when I was doing my project. The problem is how to detect the network adapter by using the Visual Basic 6. Somebody can help me~~!?
Gray
|
|
|
|
|
The best way to do that is to use Windows Management Instrumentation. Other than that, your going to have to write alot of code to call into the Win32 API and get back the data structures you need.
What are you looking for specifically?
RageInTheMachine9532
|
|
|
|
|
I see~~~!!
Thanks for your answer~~~!!
^_^
|
|
|
|
|
Platform: VB6
I would like to pass a user defined type to a form. What I get is:
Compile error:
Only public user defined types defined in public object modules can be used as parameters or return types for public procedures of class modules or as fields of public user defined types.
I understand that the compiler is whining that it doesn't know what the user defined type is composed of, but how do I go about describing the type definition to the compiler, before it reaches the form.
Also, I cannot find any definition of what a 'public object module' is supposed to be in VB6.
------------------------------
A simplistic example would be:
Project entry point: TestFrame.Main
Form: frmBaseUse
Option Explicit<br />
<br />
Private udtmThing As UserDefinedType<br />
<br />
Public Sub Begin(ByRef udtThingy As UserDefinedType)<br />
<br />
' Make the passed in structure local to the form.<br />
udtmThing = udtThingy<br />
Call Me.Show(vbModal)<br />
End Sub
Module: TestFrame
Option Explicit<br />
<br />
Public Type UserDefinedType<br />
iX As Integer<br />
iY As Integer<br />
End Type<br />
<br />
Public Sub Main()<br />
Dim udtThg As UserDefinedType<br />
Dim fUseIt As New frmBaseUse<br />
<br />
udtThg.iX = 1<br />
udtThg.iY = 2<br />
<br />
Call fUseIt.Begin(udtThg)<br />
End Sub
------------------------------
Thanks for your help.
denimined
|
|
|
|
|
Hi All:
I have this function in VC DLL that I would like to call with VB but I am not sure how to declare it.
VC Function:
Syntax:
void _stdcall PlayRequest(
DWORD ClientHandle, //Input parameters
long OutputChannel, //Input parameters
DWORD PlayerHandle, //Input parameters
PlayerInitData SegmentInfo, //Structure; //Input parameters
OSDInitStruct DisplayInfo, //Structure; //Input parameters
PlaySpeedType PlaySpeed, //Input parameters
LONGLONG *pActualStart, //Output
LONGLONG *pActualEnd, //Output
VideoType *pTypeOfVideo, //Output
bool MOL, //Input
void *CMDReserved[20], //An array of pointers reserved for future
use. Should be NULL. // Input
void *RSTReserved[10], //An array of pointers reserved for future
use. Should be NULL.// Output
AOUResult *pResult //Output
);
PlayerInitData
A structure used to initialize the player.
Syntax:
typedef struct{
TCHAR LoggerIPAddress[40];
long TokenNumber;
long ChannelID;
LoggerTime StartTime;
LoggerTime EndTime;
long ChannelType;
}PlayerInitData;
LoggerTime
A structure used for Recorder time
Syntax:
typedef struct
{
long lDate;
long lTime;
}LoggerTime;
OSDInitStruct
A structure used to set the information displayed in the On-screen Display.
Syntax:
typedef struct {
COLORREF m_colorText; //Long
LOGFONT m_fontText; //Structure
TCHAR m_szStaticText[40];
DWORD m_dwOSDBitmap;
} OSDInitStruct;
/* Logical Font */
#define LF_FACESIZE 32
typedef struct tagLOGFONTA
{
LONG lfHeight;
LONG lfWidth;
LONG lfEscapement;
LONG lfOrientation;
LONG lfWeight;
BYTE lfItalic;
BYTE lfUnderline;
BYTE lfStrikeOut;
BYTE lfCharSet;
BYTE lfOutPrecision;
BYTE lfClipPrecision;
BYTE lfQuality;
BYTE lfPitchAndFamily;
CHAR lfFaceName[LF_FACESIZE];
} LOGFONTA, *PLOGFONTA, NEAR *NPLOGFONTA, FAR *LPLOGFONTA;
typedef struct tagLOGFONTW
{
LONG lfHeight;
LONG lfWidth;
LONG lfEscapement;
LONG lfOrientation;
LONG lfWeight;
BYTE lfItalic;
BYTE lfUnderline;
BYTE lfStrikeOut;
BYTE lfCharSet;
BYTE lfOutPrecision;
BYTE lfClipPrecision;
BYTE lfQuality;
BYTE lfPitchAndFamily;
WCHAR lfFaceName[LF_FACESIZE];
} LOGFONTW, *PLOGFONTW, NEAR *NPLOGFONTW, FAR *LPLOGFONTW;
#ifdef UNICODE
typedef LOGFONTW LOGFONT;
typedef PLOGFONTW PLOGFONT;
typedef NPLOGFONTW NPLOGFONT;
typedef LPLOGFONTW LPLOGFONT;
#else
typedef LOGFONTA LOGFONT;
typedef PLOGFONTA PLOGFONT;
typedef NPLOGFONTA NPLOGFONT;
typedef LPLOGFONTA LPLOGFONT;
#endif // UNICODE
Thanks
|
|
|
|
|
I have made vb app that uses ADO 2.1 for connecting to an Access 2000 database.
My app is working fine on every computer except One. As soon as the app connects to the database, it returns the
following error:
3706, Provider cannot be found. It may not be properly installed., ADODB.Connection
This computer has Win2k Pro SP4 / Access 2002 / MDAC 2.5 SP3 (I used Component Checker to find this out.)
The user of this computer is pretty sure that Win2k SP4 was run by the Administrator of the computer
so it is not a matter of privileges to access the drivers.
The Micosoft Access Driver (ODBCJT32.dll) version is same as on my computer, where the app is working fine.
I have tested my app on another computer that has Win2k Pro SP4 with MDAC 2.5 SP3...it works fine there.
I have successfuly tested my app on different Windows OSes from (9x to XP pro) with MDAC ranging from "UNKNOWN" (as the Component Checker put it) to 2.7 Sp1/RTM.
Unfortunately, the app is to be only used on this problematic computer.
If anybody has encountered such a problem or has any ideas on this, pls do reply.
Thanx in advance.
|
|
|
|