For Access 2000/2002/2003'returns the database file nameCurrentProject.Name'returns the database pathCurrentProject.Path 'returns the database path and the file nameCurrentProject.FullName For Access 97'returns the database file nameDir(CurrentDb.Name) 'returns the database pathLeft(CurrentDb.Name,Len(CurrentDb.Name)-Len(Dir(CurrentDb.Name))) 'returns the database path and the file nameCurrentDb.Name'returns the directory that Access [msaccess.exe] is installed in(SysCmd(acSysCmdAccessDi...
Friday, November 30, 2007
Get the Path to the MS Access Database (.mdb) File
Author: xiaoyu
| Posted at: 2:08 PM |
Filed Under:
ms access
Thursday, November 29, 2007
Replace apostrophe in PHP
Author: xiaoyu
| Posted at: 8:59 PM |
Filed Under:
PHP
When creating SQL statements, string values are delimited using apostrophes. So what happens when there is an apostrophe in the data you are trying to insert? A SQL error will occur if, for example, the value of a variable included an apostrophe. Because you do not know what the user will type in, you must assume they are entering all sorts of bad data. To insert an apostrophe into the database using SQL you need to put two apostrophes in the text where you want just one. For example, to insert the phrase "what's it?" into a...
Tuesday, November 20, 2007
Pass Parameter Value from Form to Query
Recently working with extracting data from Access Database and export it to an excel file. To achieve all these, I created a query that pulls up some data from a table which contains a condition that must be filled in by the user. In other words, I need to pass parameters from Form to Query.Hence when I ran the query, there is an “Enter Parameter Value” dialog box prompted out that must be filled. This is because the query itself actually has a WHERE statement, for example SELECT * FROM table_name WHERE field_name = VAR1;I tried...
Monday, November 12, 2007
Timeout Expired in ASP .NET
Author: xiaoyu
| Posted at: 7:02 PM |
Filed Under:
.NET

This error occurs when a database query or stored procedure’s execution time beyond a pre-set timeout period. When you are trying to retrieve a huge amount of data, more execution time may be required.There are 2 main Timeout properties in .NET:1. Connection Timeout – It could be solved by setting ConnetionTimeout property in your connection string. For example:<add key="DBConnection" value="server=localhost;uid=sa;pwd=;database=dbName;Connect...
Wednesday, November 7, 2007
HIDE/UNHIDE ROW/COLUMNS IN EXCEL
Author: xiaoyu
| Posted at: 9:14 PM |
Filed Under:
excel

Sometimes when you open an Excel file, you will notice that some columns are missing. This is one of the features to unhide and hide rows and columns in the worksheet without affecting calculations in any way. Hiding rows and columns can be displayed in two ways:1. Select rows and columns that you wish to hide, and then go to Format -> Row or Column -> Hide. 2. Select rows and columns that you wish to hide, and...
Tuesday, November 6, 2007
ORACLE ERROR: ORA-28000: The account is locked
Author: xiaoyu
| Posted at: 3:04 PM |
Filed Under:
oracle
One of my colleagues is getting the following error when tried to logging into a business object which using oracle database, and got this error. Finally a quick web search gave the solution. Cause: The user has entered wrong password consequently for maximum number if times specified by the user’s profile parameter FAILED_LOGIN_ATTEMPTS or the DBA has locked the accountAction: Wait for PASSWORD_LOCK_TIME or contact DBADBA must unlock these accounts to make them available to users. Look at the script below to unlock a user:ALTER...
Monday, November 5, 2007
Run a Query to Show All Table
Author: xiaoyu
| Posted at: 2:05 PM |
Filed Under:
my sql,
oracle,
sql server
Mysql:This allows you to see all existing tables inside the database selected. mysql> SHOW TABLES;Oracle:Oracle doesn't support the above command, though an equivalent would be to use this sql statement: sql > SELECT * FROM tab WHERE TABLE_TYPE = 'TABLE'; orsql > SELECT * FROM cat WHERE TABLE_TYPE = 'TABLE'; orsql > select * from user_objects where object_type = 'TABLE';SQL Server:Run the script below in your query analyzer.SELECT * FROM INFORMATION_SCHEMA.TABLES where TABLE_TYPE = 'BASE TAB...
Saturday, November 3, 2007
如何拯救遗失文件
Author: xiaoyu
| Posted at: 10:05 AM |
前几天在报章上看到了“拯救遗失文件有妙方”的报导,想和大家分享一下。电脑系统崩溃,重新装置软件系统,把原本存档的文件都给删除了,这是多么令人头痛的事。许多人不知道原来各种数码资料,包括储存在电脑硬盘,相机,手机,录像机,还有还有CD,DVD光碟,MP3曲目,删除了都能被拯救还原的。一般人认为按了Delete按钮后,资料就找不回了,其实并不然。当你删除某些资料时,电脑操作系统(Operating System)只是把资料所占据的硬盘空间贴上(free space)标志,之后再重用这一块空间来记录其它资料。但是如果时间过得太久了,同一块空间被重复用了很多次之后,以前的数据就未必能找的回了。如何拯救文件当我们不小心删除了重要文件时或电脑系统倒垮时,首先要确保不要再继续储存新的文件,以免资料被改写。如果使用Windows电脑视窗,可先到“回收站”(Recycle Bin)文件夹检查该文件是否还在。如果还在,按“全部恢复”即可。如果文件已经不在“回收站”了,只要不再加入新资料改写了原本损失资料的位置。请依照以下指示:1. 从www.adrc.net下载“ADRC Recovery Tools”的免费软件。它能帮助“复删除”(un-delete)文件。2....
Something useful with virtual Keyboard
Author: xiaoyu
| Posted at: 9:58 AM |
An alternative keyboard in Windows -In case your keyboard or some keys stop working, Microsoft provides you with an alternative way to type in using the mouse.To work this tool, goes to 'Start menu'Then Select 'Run'Type in 'OSK'Press OKA keyboard will appear that you can use as normal keybo...
Friday, November 2, 2007
Splitting a Microsoft Access Database
Author: xiaoyu
| Posted at: 1:26 PM |
Filed Under:
ms access
In this article, I will mention about the pros and cons of splitting the database, and implementing how to split a database step by step.Generally, you will split your MS Access database into front-end database and back-end database, which back-end application will contains only the database table and front-end application will contain all of the queries, forms, reports, macros and modules. In a multi-user environment, the front-end database will be distributed to each client machine, and the back-end database will be installed...
Thursday, November 1, 2007
Option Explicit and Option Strict in VB .NET
Author: xiaoyu
| Posted at: 11:14 AM |
Filed Under:
.NET
Generally it is a MUST to put ‘Option Explicit’ and ‘Option Strict’ at the top of all my .net classes. Option Explicit StatementBy default, the Visual Basic .NET or Visual Basic 2005 compiler enforces explicit variable declaration, which requires that you declare every variable before you use it.Option Strict Statement‘Option Strict’ keeps VB developers coding bad casts. By default, the Visual Basic .NET or Visual Basic 2005 compiler does not enforce strict data typing.In Visual Basic .NET, you can convert any data type to any...
Subscribe to:
Posts (Atom)