|
Johan wrote: you won't have to struggle with getting Word to work and accept input, etc, etc.
Carter Langley wrote: battling is putting it mildly
Which costs more vb.net or your mental health?
But seriously, besides the comments I posted earlier, I am afraid I can't help you further. My suggestion is to post only the bottom part of the code you posted in a new question:
Carter Langley wrote: Set rstSearch = New ADODB.Recordset
rstSearch.Open "SELECT * FROM SQLSearchTextString", Cnn, adOpenDynamic, adLockOptimistic
If Not rstSearch.EOF Then
rstSearch.Delete adAffectCurrent
End If
rstSearch.AddNew
rstSearch.Fields("sqlsearch") = strSearch
rstSearch.Update
rstSearch.Close
'Start Word and open the document template.
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
Set oDoc = oWord.Documents.Add
oDoc.PageSetup.Orientation = wdOrientLandscape
oDoc.PageSetup.LeftMargin = 10
oDoc.PageSetup.RightMargin = 10
oDoc.PageSetup.TopMargin = 30
'Insert a paragraph at the beginning of the document.
Set oPara1 = oDoc.Content.Paragraphs.Add
oPara1.Range.Text = "Diamant Drilling Services Run Report"
oPara1.Range.Font.Name = "Arial Rounded MT Bold"
oPara1.Range.Font.Color = wdColorBlue
oPara1.Range.Font.Size = 28
oPara1.Range.Font.Bold = False
oPara1.Range.InsertParagraphAfter
oPara1.Range.InsertParagraphAfter
Set oPara1 = oDoc.Content.Paragraphs.Add
oPara1.Range.Text = "QDC"
oPara1.Range.Font.Name = "Arial"
oPara1.Range.Font.Color = wdColorBlue
oPara1.Range.Font.Size = 8
oPara1.Range.Font.Bold = True
It works so far so i must say i am quite pleased with myself.
my problem is with the range object i think. i need to have more than one word on a line and i just cant seem to do this. the first line is to have the headers and the following lines are to have the information organised under the relevent headers.
I am sure that someone can help you with this, because it is not at all an uncommon automation project.
Carter Langley wrote: my probably totally unprofessional attempt at coding
And don't sell yourself short. The question of professional or unprofessional coding is only interesting for the hardcore C++ nerds (they seem to have a real hangup about it ).
Good luck with it,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
hi,
i had used internetwritefile in vb6 it worked fine.but when i m using in vb.net it is returning 0.any sample will help me alot.
tx
|
|
|
|
|
Why are you even using it when there is a Ftp client already built into the .NET Framework 2.0, using the FtpWebRequest[^] and FtpWebResponse[^] classes.
|
|
|
|
|
i am deveoping a project with vb as frontend and sql as back end and any data entered through the vb form should automaticaaly get updated in sql table. I have tried with adodb connection but failed to succeed in it. Plz can u send me the code to connect from front end vb to backend sql with updations done regularly when code is added
Thanking you,
shaheen
|
|
|
|
|
Dim Cnn As ADODB.Connection
Dim Rst As ADODB.Recordset
set cnn = new adodb.connection
Cnn.Open "Your database connection statement goes here"
set rst = new adodb.recordset
rst.open "Your SQL Query Statement",Cnn,adOpenDynamic, adLockOptimistic
you can now manipulate your database information, like add, delete, etc.
hope this helps. this works for VB6 when you have referenced ado.
|
|
|
|
|
i am deveoping a project with vb as frontend and sql as back end and any data entered through the vb form should automaticaaly get updated in sql table. I have tried with adodb connection but failed to succeed in it. Plz can u send me the code to connect from front end vb to backend sql with updations done regularly when code is added
Thanking you,
shaheen
|
|
|
|
|
There is an SQL Client provider that you can use. I'm not sure if you have to install it or it is part of the core package. Try looking for DataAdapters/Command/other database objects here:
System.Data.SqlClient
If you need connection string information try this site:
http://www.connectionstrings.com/[^]
Hope this helps.
|
|
|
|
|
hi,
i am developing a client-server application in vb.net.
I am using a socket class in it.
I declared one object in my client application as:
dim clientSck as TcpClient
clientSck.connect(ipaddress,portno)
here if server application is not running it raised the exception,
so how this can be handled, how can i include state property to check state connected or not.
Please tell the solution.
|
|
|
|
|
d_smita wrote: dim clientSck as TcpClient
clientSck.connect(ipaddress,portno)
here if server application is not running it raised the exception,
Wrap this in a Try/Catch block to get the exception and handle the problem however you want.
Try
clientSck.Connect(ipaddress.portno)
Catch ex As SocketException
' The Connect call threw an exception
' Do whatever you need to do to handle the situation
End Try
The TcpClient class already exposes a Connected property. It's true if a connection was successful, otherwise false.
|
|
|
|
|
can i protect my files by applying the password using the vb.net.i mean can i apply some restrictions.I want to start fom the scratch.what should I do?
-- modified at 6:37 Friday 25th May, 2007
|
|
|
|
|
Nilish wrote: can i protect my files by applying the password
If you were talking about password protecting any file, not just your own application, then no, you cannot do this. This requires writing a low-level file system extension to support this, writing a database manager to hold all of the passwords, writing a utility to manage the password database, and finally, comming up with a method to recover a file if the user ever forgets the password (like that ever happens! )
This requires a blackbelt in Windows internals and NTFS. No, there is no guide to walk you through something like this.
If you were talking about protecting the data files of your own application, then you'd have to code this into your app. You could encrypt the file with the password making it look like a pile of junk if opened in something like Notepad. This will NOT stop any other application from opening the file! It just encrypts the data in it!
|
|
|
|
|
Hi,
I want to commands in vb.net to backup my Mysql Database.
Can anyone please help me?
Thanks in advance.
bye.
Thanks & Regards
Gita
|
|
|
|
|
gitasnr wrote: I want to commands in vb.net to backup my Mysql Database.
Can anyone please help me?
VB.NET does not do this. MySql does this. Send the command to MySql through the appropriate data provider's command object. (I'm guessing you've got a MySqlCommand object from somewhere).
|
|
|
|
|
Thanks,
but i know this mysql does this. but i m not getting the mysql command to take backup & restore it. I will try to execute those commands in vb.net.
If u know the mysql commands for backup & restore plz tell me.
thanks
bye.
Thanks & Regards
Gita
|
|
|
|
|
|
Dave Kreskowiak wrote: It's absolutely amazing what you find with a little help from Google.
That's just shocking! What are they doing indexing that kind of thing?!
|
|
|
|
|
I swear, lately, about 80% of the questions that show up can be answered by a single Google.
I especially love the ones that start with "Where can I find...". Hey! Maybe we could add some code behind the forum Submit button to automatically put the posters question into Google and return a search page, without posting the question to CP!
|
|
|
|
|
User wrote: Help me ! Urgent.
Just checked, even this question will return answers related to programming, in fact amazingly many.
SAP support actually already uses the technique your suggesting to filter out all the
User wrote: Help me ! Urgent. Someone stole my Any key!
messages. Except that they make users go through posted articles before they can log a question.
You might actually be on to something.
My advice is free, and you may get what you paid for.
|
|
|
|
|
I was trying the command line arguments to get the path of the selected folder programatically in vb.net.
It is working fine except one thing
if the folder name is like c:\abc def
then i am getting c:\abc
if the folder name is c:\abc
then the output is correct.
in command line argument
i am using
application path %1
eg
c:\abc.exe %1
Please help
|
|
|
|
|
If the path contains spaces then put it in quotes in the command line.
MyApplication "c:\My Path With Spaces\some file.txt"
or, if you are using a batch parameter
MyApplication "%1"
|
|
|
|
|
Thank You Sir.
|
|
|
|
|
Hello friends,
I stored an image from my front end(VB) into SQL database on a datatype image. Then how can I show that image in VB. Please help
While loading it through recordset I get this '????' .
|
|
|
|
|
Actually wat u want
Regards;
Sherin PM
Quadra Software Solutions Pvt. Ltd.
Email:Sherin_pm85@yahoo.com
|
|
|
|
|
This is the sample Code
where 'FileContent' is the field name of Image and it will save the file in C:\ to open File, where document COde is the primary key in table.This Code opens all kind of File.
Dim RstRpt As New ADODB.Recordset
Set RstRpt = "Select FILECONTENT from tablename" _
& " Where DOCUMENTCODE ='" TXTBOX1.TEXT & "',CNN,ADOPENKEYSET)
Set strStream = New ADODB.Stream
strStream.Type = adTypeBinary
strStream.Open
strStream.Write RstRpt.Fields("FILECONTENT").Value
DestinationFile = "C:\" & Trim(TXTBOX1.TEXT )
strStream.SaveToFile (DestinationFile), adSaveCreateOverWrite
'FileCopy SourceFile, DestinationFile
SetAttr DestinationFile, vbNormal
Call ShellExecute(hwnd, "Open", DestinationFile, "", "C:\", 1)
Hopefully i will help u
Ali
|
|
|
|
|
Hi friend,
I was not at site for these days. That's why i cant reply you. So what is this 'ShellExecute' i can't made it. Is there any references to add?
by Dileeeeeeeeeeep.
|
|
|
|