Setup Outlook Express for Gmail


If you’re setting up Outlook Express to work with Gmail for the first time, you’ll need to:

Check the below URL for detail or click here :

http://mail.google.com/support/bin/answer.py?hl=en&answer=13276

Setup Outlook for Gmail


If you’re setting up Outlook 2003 to work with Gmail for the first time, you’ll need to:

Check the below URL for detail or click here :

http://mail.google.com/support/bin/answer.py?hl=en&answer=13278

Check The Temperature Of Your CPU


if your PC keeps crashing for no apparent reason, and if those crashes tend to occur when the machine is busy doing lots of things, there’s a pretty good chance that the problem is down to an overheating CPU.  Maybe one of the fans in your system has stopped working, or an air vent is blocked with dust.
To help diagnose such problems, here’s a wonderful little Windows utility that tells you the current internal temperature of your CPU.  If the chip has multiple cores, it’ll even give you a separate reading for each. And if there are multiple CPUs, that’s catered for too.
It runs on Windows XP and above, and supports a wide variety of CPU types from Intel and AMD.  And it’s only a 0.5 MB download.  Plus, it’s available in 32- and 64-bit versions, including a portable version that can be run  directly without needing to be installed.
The program is called CoreTemp, and you can get it from    www.alcpu.com/CoreTemp.

CoreTemp

Reference URL

Read Data from Excel (VB Code)


Private Sub cmd_browse_Click()
On Error Resume Next
Dim FNum As Integer
Dim txt As Recordset
On Error GoTo FileError
CommonDialog1.CancelError = True
CommonDialog1.Flags = cdlOFNFileMustExist
CommonDialog1.DefaultExt = “xls”
CommonDialog1.Filter = “Excel file|*.xls|*.*”
CommonDialog1.ShowOpen
FNum = FreeFile
pathtxt.Text = CommonDialog1.FileName
Close #FNum
Dim cnExcel As New ADODB.Connection
Dim rs As New ADODB.Recordset
With cnExcel
.Provider = “Microsoft.Jet.OLEDB.4.0”
‘.ConnectionString = “Data Source=” & App.Path & “\Contact.xls;” & “Extended Properties=Excel 8.0;”
.ConnectionString = “Data Source='” & pathtxt.Text & “‘;Extended Properties=Excel 8.0;”
.Open
End With
Dim strQuery As String
strQuery = “SELECT * FROM [Sheet1$]”
rs.Open strQuery, cnExcel, adOpenStatic, adLockReadOnly
‘totaltxt.Text = rs.RecordCount
‘MsgBox “Total records: ” & rs.RecordCount
‘MsgBox “Reading first record…”
‘MsgBox “ID: ” & rs(i)
‘MsgBox “NAME: ” & rs(j)
‘MsgBox “AGE: ” & rs(k)
‘MsgBox “Saving into Access…”
Dim cnAccess As New ADODB.Connection
With cnAccess
.Provider = “Microsoft.Jet.OLEDB.4.0”
.ConnectionString = “Data Source=” & App.Path & “\temp.mdb;”
.Open
End With
Dim cmdAccess As New ADODB.Command
cmdAccess.ActiveConnection = cnAccess
If rs.EOF = False Then
On Error Resume Next
Dim i As Integer
For i = 0 To rs.RecordCount
cmdAccess.CommandText = “Insert into table1 values (‘” & rs(0) & “‘,'” & rs(1) & “‘,'” & rs(2) & “‘,'” & rs(3) & “‘,'” & rs(4) & “‘,'” & rs(5) & “‘,'” & rs(6) & “‘,'” & rs(7) & “‘,'” & rs(8) & “‘,'” & rs(9) & “‘,'” & rs(10) & “‘,'” & rs(11) & “‘)”
cmdAccess.Execute
rs.MoveNext
Next
End If
Call totalrecordcount
Call droptb
Call temptb
Call countrecorsd
cmdprint.Enabled = True
cmd_browse.Enabled = False
MsgBox “Data Successfully Transfer to temp.mdb”, vbInformation
‘Call cmddel_Click
FileError:
If Err.Number = cdlCancel Then Exit Sub
End Sub

Access SQL Server Instance from the network


Whenever we create any SQL instance and after that if we want to access from our network.
We need to setup some setting on Client Machine also! This is  only point that people missed

Now we need to install the Client Network Utility on Client Machine and following setting needs to be done.

 

· Open Client Network Utility
· Go to “Alias” Tab
· Click on “Add…” Button
· Just type the Server alias (see eg. ABC-1\111) “ABC-1” is server name and “111” instance name
· Click “OK”

After applying above you can access your instance(sqlservername\instancename) from network.

VB Code for Log or Tracking


Dim LFNum As Integer
Dim PLFName As String
‘blnfileopen As Boolean

Public Sub OpenFile()
LFNum = FreeFile
PLFName = App.Path & “\proglog\” & Format(Day(Date), “00”) & Format(Hour(Time), “00”) & Format(Minute(Time), “00”) & Format(Second(Time), “00”) & “.txt”
Open PLFName For Output As LFNum
Print #LFNum, “Logging Started at…..” & Date; ” “; Time
Print #LFNum, “”
‘blnfileopen = True
End Sub

Public Sub LogData(msg As String)
‘If Not blnfileopen Then OpenFile
Print #LFNum, msg
End Sub

Public Sub closefile()
Print #LFNum, “”
Print #LFNum, “***** Session Close at “ & Date; ” “; Time; “*****”
Close LFNum
End Sub

Linked Server


———————————————————
Create  Linked Server through Scripts
———————————————————

USE [master]
GO
EXEC sp_addlinkedserver
@server=’dsql2k’,
@srvproduct=”,
@provider=’SQLNCLI’,
@datasrc=’source_name’

GO

USE [master]
GO
EXEC master.dbo.sp_serveroption @server=N’dsql2k’, @optname=N’rpc’, @optvalue=N’true’
GO

EXEC master.dbo.sp_serveroption @server=N’dsql2k’, @optname=N’rpc out’, @optvalue=N’true’
GO

select * from master.dbo.sysservers
—————————————————————————
Alternative Script to Create Linked Server and Mapping of Users
—————————————————————————
Use Master
go
EXEC master.dbo.sp_addlinkedserver @server = N’dsql2k’, @srvproduct=N”, @provider=N’SQLOLEDB’, @datasrc=N’testserver’
GO

EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N’dsql2k’, @locallogin = N’sa’, @useself = N’False’, @rmtuser = N’sa’, @rmtpassword = N’sa’
GO

SQL Backup Plan with Dynamic file Name


DECLARE @day VARCHAR(5)
DECLARE @month VARCHAR(15)
DECLARE @year VARCHAR(5)
DECLARE @hour VARCHAR(5)
DECLARE @filename VARCHAR(500)

SET @day = DATENAME(DAY, GETDATE())
SET @month = DATENAME(MONTH, GETDATE())
SET @year = DATENAME(YEAR, GETDATE())
SET @hour = DATENAME(HOUR, GETDATE())
SET @filename = ‘D:\DATABASE Backup\db_name_’ + @day + @month + @year + @hour +.bak’

Backup DATABASE db_name TO Disk = @filename WITH format
BACKUP log db_name TO disk = @filename WITH format

Move SQL Server Databases Using Detach and Attach


–How to move SQL Server databases to a new location by using Detach and Attach functions in SQL Server
–Prerequisites
–Note You can determine the name and the current location of all files that a database uses by using the 
sp_helpfile stored procedure

use
go
sp_helpfile
go

–Detach the database as follows:

use master
go
sp_detach_db ‘mydb’
go

–Next, copy the data files and the log files from the current location (D:\Mssql7\Data) to the new location (E:\Sqldata).
–Re-attach the database. Point to the files in the new location as follows:

use master
go
sp_attach_db ‘mydb’,’E:\Sqldata\mydbdata.mdf’,’E:\Sqldata\mydblog.ldf’
go

–Verify the change in file locations by using the sp_helpfile stored procedure:

use mydb
go
sp_helpfile
go

–The filename column values should reflect the new locations.