Accessing system property is pretty easy with VB6 code. This can be useful when programmers need to refer the system name in the code. Steps Declare the GetComputerNameA function which resides in the kernel32 library. Create a function to fetch the Computer Name. Use the function The Kernel functions Declare Function GetComputerNameA Lib "kernel32" (ByVal lpBuffer As String, nSize As Long) As Long Get the computer name Define a new function to do the rest of the task. So you can reuse the code. Public Function GetComputerName() As String Dim sResult As String * 255 GetComputerNameA sResult, 255 GetComputerName = Left$(sResult, InStr(sResult, Chr$(0)) - 1) End Function Calling the function Just invoke the function and place values to a TextBox Text1.Text = GetComputerName
When we have the problem with READ ONLY SQL DATABASE(It can happen while we trying to attach different version database file). First up all we need to make the security of ldf and mdf file to everyone/current user, preferably Full Control. And then simply execute the script ( if this script not working, do the same for folder and drive in which the database file resides. ) USE [master] Go Alter database [readonlydb] set READ_WRITE WITH NO_WAIT GO Or use the query without the NO_WAIT option. USE [master] Go Alter database [readonlydb] set READ_WRITE GO
In access database, we can copy rows from one table to another using query. How can we transfer rows from one database to another? Using the in keyword in Insert statement we can specify an external database path as follows in access query insert into Account_Transactions(Date ,Name ,Type ) in 'D:\Sherpharma\T.mdb' select Account_Transactions.Date,Account_Transactions.Name,Account_Transactions.Type from Account_Transactions Here we copy the rows from current database to the T.mdb files. We can also use this query in programming as well.
Comments
Post a Comment