Wednesday, 3 April 2013

shrink database in sql server 2008

Step1:
ALTER DATABASE BASE SET RECOVERY SIMPLE
 --Execute this line.
Step2:
-- Find the log file of data base.
SELECT name
FROM sys.database_files
WHERE type_desc = 'LOG'


Step3:
DBCC SHRINKFILE ('FINANCE_log', 1000)

OR
 Go to object browser-> then select database and make right click->Select TASK->SHRINK->Files
shrink window will open.
Choose File Type as LOG from dropdown control. Then click OK

DO it your OWN RISK.


VB6 and Crystal Reports 8.5

1. We can display the column value in crystal reports 8.5 through SP. Suppose the column is in varchar type and size of 1000.  That column will not display in formula field to apply formula.

2. In VB application we can use Rich text box control. In this control user can type the enter key to break the line. When we display the content of rich text box value in crystal report the line will break as per enter key value. In this case we can use Replace string formula (which available in crystal report formula section) .
Find string is chr(10),chr(13)  these are enter key value and replace with "" (space).


Tuesday, 5 March 2013

Open Excel File in VB6

Private Sub Command1_Click()

On Error GoTo ErrHandler
    Dim xlApp As Object
    Dim xlWB As Object
    
    Set xlApp = CreateObject("Excel.Application")
    xlApp.Visible = True
    
    Set xlWB = xlApp.Workbooks.Open("c:\Counselor.xls")
    Exit Sub
    
ErrHandler:
    MsgBox "There is a problem opening that workbook!", vbCritical, "Error!"
  End Sub 

http://www.mrexcel.com/forum/general-excel-discussion-other-questions/261062-simple-vb6-code-open-excel-file.html

Thursday, 21 February 2013

Date Before one month in VB6

Date Before one month in VB6
DateAdd("m", -6, dCurrentDate)

In VB6 File exists or Not

    Private Sub Command1_Click()
    '============================
    Dim fso As FileSystemObject
    Dim sFilePath As String
    
        Set fso = New FileSystemObject
      
        sFilePath = "c:\test.txt"
        If fso.FileExists(sFilePath) Then
            MsgBox "File Exist."
        Else
            MsgBox "File Doesn't Exist."
        End If
    
    End Sub

Wednesday, 9 January 2013

Ceil function in VB6

VB Code:
  1. Function Ceiling(n As Double) As Long
  2.     If Not Int(n) = n Then
  3.         Ceiling = Int(n) + 1
  4.     Else
  5.         Ceiling = n
  6.     End If
  7. End Function

Tuesday, 18 December 2012

Remove autorun.inf file

Remove autorun.inf file


1) Going to the first step, Please Disable CD or DVD/USB autorun in the windows


2) Open the Winrar.exe ( start > Programs >Winrar> Winrar.exe )
                                       

3) Now browse the infected file through the Winrar application


4) We can watch the hidden files for the particular drive using Winrar now.


5) Look for the file autorun.inf and open by using Notepad


6) When you open, We can find a >exe file in that.It is the main danger .


7) Note this .exe file and close the autorun.inf file


8) Now look for that .Exe file in the Drive (e.g d:/ ) ,Now delete the autorun.inf file and .exe file together


9) Restart your system, now there is no virus in your system.