Showing posts with label database. Show all posts
Showing posts with label database. Show all posts

January 24, 2017

C# Insert Data into Access Database using parameters

Simple User Registration form that show how to add new record from form into Access Database using parameters.
For Beginners.

What I learn.

  • How to connect to Access 2013 database.
  • Inserting Date/Time to the database.
  • Using Parameter insert queries.


TABLE

FORM

CODE



August 24, 2016

How to fix Microsoft SQL Server Error: 18456, cannot log-in.

I've encountered this error many times when I tried to log in to my SQL Server prior to assigning administrator privileges to the user. This error occur because the user you use to connect to the server using windows authentication doesn't have a permission to log-in or your username and password are incorrect.

The Error look like this.

Event ID :18456 
Connect to Database Engine
Cannot connect to "SQLServerName"
Additional Information: Login failed for "your user name".(Microsoft SQL Server, Error 18456)



But the common cause of this is the username you use is not a member of administrators group.
This is how to solve it.


  1. Go to control panel > computer management
  2. On expand to Local user and Groups > Users
  3. right click on the user you want to use to login to SQL Server then select properties
  4. Then on Member of tab, click add then type administrators

This applies to MS SQL Server Express 2014, MS SQL Server 2013, MS SQL Server 2012
Try again to log to your MSSQL using the user you grant permission as administrator.

August 10, 2016

How to fix MS access always maximize when opening a form.

When you working on Microsoft Access 2007 or higher you will notice that when you open the ms access the form is maximized even though you customized it to the size you want. It is because the default settings of  document window option in MS Access is set to Tabbed documents, You must set it to overlapping windows to prevent maximized of the form on start of MS access applications.


You can easily fix this by doing the following procedure.

1. On MS Access click access logo(file) then click Access Options.


2. On Current Database tab > Application Options then select Overlapping Windows.

That's it! Hope it helps. Thanks!

August 4, 2016

Cannot connect to SQL Server Express from other computer.

Lately, I have a task to install an SQL server on Windows 10 and Nine clients are mix with windows 7 and 10. I used SQL  Server express 2014 as my back-end database and c#, Ms Access through ODBC as my front-end. And now my Database is running smoothly, but before this I countered a problem connecting to database server from other computer on my network. I'm sharing this so if anyone encounter the same can look into this.
  1. Make sure SQL server is running - To check if it is running on Run type services.msc then find SQL Server see if it is running and set to automatically. Else click start or restart.
  2. Make sure both database server and clients are on the same network domain or work group. To change the work group or domain. Right click This PC(my computer) click properties then on computer name tab you can change the workgroup or join the domain.
  3. Firewall Settings - Check the windows firewall settings of the computer where the SQL server express is installed, usually SQL Server port is 1433 make sure it is allowed by your firewall. Disable the windows firewall and try to connect again.
  4. Enable remote connections in your SQL Server Instance - SQL Server Express is set to allow only local connections as default. You need to allow remote connections for the other computer in your network to access your database. 
    1. Enable TCIP Connection - Go to the Computer where SQL server is installed then on Start > Programs > Microsoft SQL server > SQL Server Configuration Manager.  On SQL Network configuration > Protocol for SQLEXPRESS(your instance name) then enable TCP/IP.
    2. Allow network connection on the SQL server instance - Open SQL Management studio then log-in using your authentication, right click on your server name then click Properties, click on connections check on allow network connections to this server, Finally set 600 on remote query time out.

Hope it helps.