|
look up the Access command:
docmd.tansfertext
|
|
|
|
|
does anybody knows how to import data from excel file and store it in a Microsoft Access Database Table.
plz help me with this.
thnx
Aakash
|
|
|
|
|
Open a blank DB
Go to New
Import table
Navigate to the excel file you want imported
Click import
A wizard will now open asking things like "use top row as headings", etc. Follow the wizard and your table will be there
I've always heard that there was an idea behind Win ME... I still can't figure out what that was... anyboy know??? I;ve herad the idea was that it was supposed to be n operating system but I doubt this. - Brian Delahunty
|
|
|
|
|
Hmmm... you emailed me, but no message here.
Oh well - hopefully this helps. Sorry, I didn't realise you were asking for code, as your question only asks how to do it.
What I do (but perhaps I shouldn't spread this possibly bad practice) when I need code for VBA is open the program (in this case Access) and start recording a Macro. Then perform all the actions for importing the excel spreadsheet to an Access table. Stop recording the Macro, view the Macro code - it will give you everything
Hope that is of more use to you
I've always heard that there was an idea behind Win ME... I still can't figure out what that was... anyboy know??? I;ve herad the idea was that it was supposed to be n operating system but I doubt this. - Brian Delahunty
|
|
|
|
|
does anybody knows how to import data from excel file and store it in a Microsoft Access Database Table.
plz help me with this.
thnx
Aakash
|
|
|
|
|
You can use the OleDb ADO.NET classes to access both MS Access and Excel datasources... it's works in pretty much the same way as the SqlDb classes when accessing a SQL Server database. The hard part is the connection, everything else is pretty much the same as importing/exporting data from other datasources...
See these knowledge base articles if you need more information and sample code...
HOW TO: Query and Display Excel Data by Using ASP.NET, ADO.NET and Visual Basic .NET - http://support.microsoft.com/default.aspx?scid=kb;en-us;Q311731
HOW TO: Use the ODBC .NET Managed Provider in Visual Basic .NET and Connection Strings - http://support.microsoft.com/default.aspx?scid=kb;en-us;Q310985
The last one is an example of connection strings for many different db types. It uses OdbcDb but can easily be changed to OleDb, if you please.
steve
|
|
|
|
|
can anybody plz tell me how to provide environment similar to Microsoft Excel in VB.net.
for ex :
how to make data entry form in vb.net similar or like excel.
bye
Aakash
|
|
|
|
|
if there is a form in Vb.net then how to disable the close button in that.
and there is one form1 which is starting form of my application and I want to start it maximized . how do I do that ?
plz help
thnx
aakash
|
|
|
|
|
To disable the close button in a form, add this module to your project...
<br />
Option Explicit<br />
Option Private Module<br />
<br />
Public Declare Function GetSystemMenu Lib "user32" _<br />
(ByVal hwnd As Long, _<br />
ByVal bRevert As Long) As Long<br />
<br />
Public Declare Function RemoveMenu Lib "user32" _<br />
(ByVal hMenu As Long, _<br />
ByVal nPosition As Long, _<br />
ByVal wFlags As Long) As Long<br />
<br />
Public Const MF_BYPOSITION = &H400&<br />
<br />
Public Function DisableCloseButton(frm As Form) As Boolean<br />
<br />
Dim lHndSysMenu As Long<br />
Dim lAns1 As Long, lAns2 As Long<br />
<br />
lHndSysMenu = GetSystemMenu(frm.hwnd, 0)<br />
'//remove close button<br />
<br />
lAns1 = RemoveMenu(lHndSysMenu, 6, MF_BYPOSITION)<br />
'
<br />
lAns2 = RemoveMenu(lHndSysMenu, 5, MF_BYPOSITION)<br />
'//Return True if both calls were successful<br />
<br />
DisableCloseButton = (lAns1 <> 0 And lAns2 <> 0)<br />
<br />
End Function<br />
Then in the form_load() event, add this
<br />
Private Sub Form_Load()<br />
Dim retval as boolean<br />
<br />
retval = DisableCloseButton(frmName)<br />
<br />
End Sub<br />
as for starting the form maximized, there should be a property window for the form with an option labeled "WindowState", just set that to "2-Maximized"
or add this to the form_load() event as well
<br />
frmName.WindowState = 2<br />
|
|
|
|
|
Hi,
I am using Mapi session logon method to logon to exchange and sc server.I have to select a profile with which i logon to servers.For this there is a dialog box.On ok click of this box two more boxes appear asking inputs for SC and exchange.
How can i avoid these 3 boxes and still be able to communicate to both the servers and retrieve there infostores.
Thanks in advance,
Amit Gupta
|
|
|
|
|
Hi can someone help me i want to skin my VB.net App can some one show me how i can do this or give me a control that will do it ??
|
|
|
|
|
Hi!
I want to read some information stored in a file.
I mean such as Comment, Title, Author or Keywords.
Are there some APIs that do that ... or must I access the file directly?
Maybe somebody have some code example for me?
Furthermore I want to write (change) this information...
Thanks
Martin
|
|
|
|
|
For MS Office documents, look at Q224351[^]
|
|
|
|
|
i am trying to print word document in VB .net. it is printing the document but it is priting couple of lines of boxes in the beginning. any idea why is doing so. here is the code:
Public Sub PrintDoc()
Dim strPCLPrint As String
strPCLPrint = Trim(lblPCLPrinter.Text.ToString)
'ByVal strDocFile As String
'pcl Print driver
Try
StreamToPrint = New StreamReader("C:\temp\6031044.doc")
Try
Dim pr As New PrinterSettings()
pr.PrinterName = strPCLPrint
MsgBox(pr.PrinterName)
printFont = New Font("Arial", 10)
Dim pd As PrintDocument = New PrintDocument()
'sets the PCL printer for doc printing
AddHandler pd.PrintPage, AddressOf Me.pd_PrintPage
'pd.CreateObjRef()
pd.DocumentName = "C:\temp\6031044.doc"
pd.Print()
Catch ex As Exception
MessageBox.Show(ex.ToString)
Finally
StreamToPrint.Close()
End Try
Catch ex As Exception
MessageBox.Show("An error occurred printing the file - " + ex.Message)
End Try
End Sub
Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As System.Drawing.Printing.PrintPageEventArgs)
Dim lpp As Single = 0
Dim yPos As Single = 0
Dim count As Integer = 0
Dim leftMargin As Single = ev.MarginBounds.Left
Dim topMargin As Single = ev.MarginBounds.Top
Dim line As String
'Work out the number of lines per page
'Use the MarginBounds on the event to do this
lpp = ev.MarginBounds.Height / printFont.GetHeight(ev.Graphics)
'Now iterate over the file printing out each line
'NOTE WELL: This assumes that a single line is not wider than the page width
'Check count first so that we don't read line that we won't print
line = StreamToPrint.ReadLine()
While (count < lpp And line <> Nothing)
yPos = topMargin + (count * printFont.GetHeight(ev.Graphics))
'Print Preview control will not work.
ev.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, _
yPos, New StringFormat())
count = count + 1
If (count < lpp) Then
line = StreamToPrint.ReadLine()
End If
End While
'If we have more lines then print another page
If (line <> Nothing) Then
ev.HasMorePages = True
Else
ev.HasMorePages = False
End If
End Sub
Thank you.
Zulfikar Ali
|
|
|
|
|
There is a great example of printing Word Documents to a Fax Device or other specific printer on www.gotdotnet.com. The site is currently down or I would provide you with a direct link.
When it is available again just search for SendMSWordDocumentViaFaxExample.
|
|
|
|
|
How do I create "excel" sheet in MDI (child) window?
|
|
|
|
|
hey,
i'm looking for a good vb or java programmer to code a program which i'm designing the GUI for. Preferably someone in the metro toronto area, and who has experience in designing programs for business. There will be pay involved (you won't be rich but you won't be hungry either) and you'll get to work on a product that will be commercially released.
if you're interested email me at rego.clothiers@sympatico.ca
Paul Rego
p.s. if you are interested, please email me directly coz i may or may not have time to come back here to check the response... I ended up at this site though another link, so I wouldn't normally post a message here.
|
|
|
|
|
I have made several attempts at overriding the backcolor property for a tabcontrol and have gotten no where. Does anyone have any suggestions
|
|
|
|
|
I need to send XML data to a site and receive the processed info.
Can any one suggest me how to go about it ?
Thanks in advance.
VIPUL BHATT
|
|
|
|
|
Try using the M$ XML parser (latest verision is 4.0 I think). If you d/l from M$, comes with both VB and C++ tutorials.
|
|
|
|
|
can anybody tell me how to get value of a textbox of form1.vb into textbox of form2.vb in Vb.net.
ex :
I have two forms form1.vb and form2.vb
both are having one textbox each
then i put some value into textbox of form1.vb
and then I load form2.vb and into that loading event I added
Form2_load()
form2.textbox1.text = form1.textbox1.text
end sub
plz tell me how to do that.
--waiting for a quick reply
Aakash
|
|
|
|
|
drmzunlimited,
Keep in mind there are many ways to do this. When I did this I created two forms, a textbox on each and a button on form1 to invoke this action, the click event of the button looks like this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As String
Dim b As Form2
b = New Form2()
a = Me.TextBox1.Text.ToString
b.TextBox1.Text = a.ToString
b.Show()
End Sub
Nick Parker
The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill
|
|
|
|
|
Ok, I have searched and searched everywhere and can find nothing. I am trying to implement my own Collection Classes. However, no matter what I try, I cannot get the "For..Each..Next" syntax to work. Evertime it tries to access it (For Each User in UsersCollection), it gives me an 'System.InvalidCastException' error.
Aside from creating Strongly Typed Collection Classes, does anyone know how this can be implemented?
|
|
|
|
|
Tim McCurdy wrote:
it tries to access it (For Each User in UsersCollection), it gives me an 'System.InvalidCastException' error.
Does your class implement IEnumerable Interface? What is wrong with using an ArrayList object?
Nick Parker
The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill
|
|
|
|
|
Hello again,
C has a function called 'strpbrk,' which stands for string point break. The function takes two arguments. First arg is the string I want to search. The second arg is a string of characters that I want to check for. If any of the characters contained in the second string are in the first string the function returns a pointer to the element in the array where the character was located.
Basically, if none of the characters in the second set are found in the first set, the function returns NULL (or zero, if you will).
Does VB have a function that performs this same operation?
my func:
[source]
' forgive my C-speak
if strpbrk( "HELP ME, PLEASE!", " SXPT" )
//character ' ' found (space)
// do something
printf("Characters found in set!");
else
//characters in second set NOT found in first set
// do something else
printf("Characters NOT found in set!");
[/source]
or
Do I have to use an array and scroll through the entire array to accomplish this?
Thanks in advance,
Like2Byte
|
|
|
|