473,802 Members | 1,937 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to add defaults in MySQL from Access data transfer

20 New Member
I used a database transfer utility (Bullzip) to move data from Access to MySQL Asp pages,

I couldn't transfer the data if i did not opt to leave the default values, therefore the default values didn't get transfered.

I checked the access database and some of the fields have default values, ie, current time to go in automatically.

Obviously, these being absent in MySQL are causing problems as they show NULL

I use MYSQL query browser, . from mysql.com, the GNU one,

Can i add the defaults using this? I also note it has a migration utility, but im not sure what i can do with it , since ive already transferred the data. I only want to add defaults.

Does anyone know a simple way for me to do it? I do have a copy of the old Access database on my desktop, so should i just manually do it?

If anyone has done anything like this, pls offer some tips. Many thanks in advance.
Nov 19 '08 #1
1 2210
janetopps
20 New Member
i'll explain in a little more detail, so it's all clear and no misunderstandin g.

I opened the old access database, right clicked and chose "design view".


This brought up some data, and i'll show you a few relevant lines from the old ACCESS database. Here are 4 columns in this table, i had to colour them differently, the bold is the top column, and their fields are in the same colour.


[COLOR="Green"]Field Name[/COLOR] [COLOR="darkoran ge"]Data type [/COLOR] [COLOR="purple"]Description[/COLOR] [COLOR=Red]Default Value[/COLOR]

[COLOR="green"]fldPosted [/COLOR] [COLOR="darkoran ge"]Date/Time [/COLOR][COLOR="purple"]Article is posted since[/COLOR]

[COLOR="green"]fldUpdated [/COLOR] [COLOR="darkoran ge"]Date/Time [/COLOR] [COLOR="purple"]Last updated[/COLOR]

[COLOR="green"]fldExpires[/COLOR] [COLOR="darkoran ge"]Date/Time [/COLOR]

[COLOR="green"]fldCREATED [/COLOR] [COLOR="darkoran ge"]Date/Time[/COLOR] [COLOR=Red]Now()[/COLOR]


Now to the new database MYSQL


I use MySqL query browser Version 1.2.13

This particular software came with various database scripts to run against a database, with a new installation.

I have an MySQL script that can be run against the MySQL database. But i think this only works if you start new, and not with a trasfer of data as im doing. I'm transferring an Access database records to MySQL


nm_tbl_news is one table in the database, the one that contains the article details when i add them. This is what the mysql script that you're supposed to run on the database when you install it says about this table

[COLOR="darkred"]CREATE TABLE `nm_tbl_news` (
`ID` int(10) NOT NULL auto_increment,
`fldTITLE` varchar(85) default NULL,
`fldCONTENT` longtext,
`fldSUMMARY` varchar(255) default NULL,
`fldACTIVE` int(10) default '1',
`fldAID` int(10) default NULL,
`fldPOSTED` datetime default NULL,
`fldUPDATED` datetime default NULL,
`fldEXPIRES` datetime default NULL,
`fldCREATED` timestamp NULL default CURRENT_TIMESTA MP,
`fldVIEWS` int(10) default '0',
`fldIMAGE` varchar(255) default NULL,
`fldVOTES` int(10) default '0',
`fldVALUE` int(10) default '0',
`fldALLOW_COMME NTS` int(10) default '0',
`fldALLOW_VOTIN G` int(10) default '0',
`fldUPDATE` datetime default NULL,
`fldHIGHLIGHT` int(10) default '0',[/COLOR]

As an experment i just ran the complete script which includes the part above, against the MySQL database and it deleted all the transferred data. However, i did see default values in the tables, when i checked "edit table" in the query browser. But the records showed 0, which means they got deleted.


Since i now had the tables and default values, but no data, that was no use to me. I then re-transferred the data from the old Access database, using Bullzip, and as i explained earlier i can't transfer the default values, as some are not recognised, so i unchecked that button. The data transferred OK, overwriting what was already there, but no default values obviously. The 3 new records i'd added to the new mysql database since the transfer obviously got deleted, so i'm back with MYSQL, with the old data.

Before i experiment and add new records, i think i'd better add some default values? In particluar the fldCreated, as this one is causing a problem on a page that relies on it.

So I guess i need to add them manually? If you look at the script above it says [COLOR="darkred"]"CURRENT-TIMESTAMP" [/COLOR]as the default value.

Just so there is no confusion, this value is supposed to remain unchanged once added, it is not the current time that it should display, but the date that the article was actually added to the database.



The record that is causing problems in particular is the fldCREATED one. The field, shows the date that the article was actually created and added to the database. It is different to the published date, because the software gives you the ability to add an article now, and set the date to appear in public for let's say, next week, as an example. So this date fldCreated remains unchanged, even though the other dates can be altered automatically, ie. if you change the published date, or the update article date, expiry date etc.

Should i add this manually in the "Edit table" facility or what? and what should i put?


Would the solution be for me to open both databases on my desktop and manually add the defaults in the MySQL query browser? I'd like to sort out the fldCREATED first, but i think i'd better do the other ones too.

Thanks in advance
Nov 19 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3949
by: Simon | last post by:
Hi, I am having a little problem with my PHP - MySQl code, I have two tables (shown below) and I am trying populate a template page with data from both. <disclaimer>Now I would like to say my skills, especially with MySQL are rudimentary</disclaimer> However my code (link below) fails, the nested database call does not return any data and this has me stumped. Any help will be much appreciated. Many thanks in advance
4
4427
by: Neil | last post by:
Hi, I hope this question isn't too far off topic....I'm almost at my wits end trying to figure this out. I have a Mysql database and I wish to automate the backup of the database because I don't wish to rely on the web host doing so. I am using the "dbsender.php" script, which is written for this exact purpose (available at hotscripts.com). If I execute the script via my browser, the database is emailed to me in a 'gzip' format, which...
1
9337
by: Samunderline | last post by:
Hello, Hi am trying to use the --defaults-file with a compiled version of mysql on a Feodra Core 2 based on Linux-2.6.5 I type the following command : /usr/local/mysql4src/libexec/mysqld --basedir=/usr/local/mysql4src --datadir=/usr/local/mysql4src/data --user=mysql4 --pid-file=/usr/local/mysql4src/data/mysql.pid --socket=mysqld.sock --defaults-file=/usr/local/mysql4src/my.cnf
5
2802
by: steve | last post by:
Hi, When I copy tables in a database from one server to another using enterprise manager, everything copies ok, except for field defaults. Has anyone seen this, and what is the solution? -- http://www.dbForumz.com/ This article was posted by author's request Articles individually checked for conformance to usenet standards Topic URL:...
7
33423
by: phillip.s.powell | last post by:
We're looking at a GUI interface for our MySQL DB and I am interested in MySQL Administrator, however, one of our requirements is to be able to import/export databases. Is this possible or do I need to know else (e.g. Navicat)? Thanks Phil
7
4199
by: Randy | last post by:
Folks: We have a web-based app that's _really_ slowing down because multiple clients are writing their own private data into a single, central database. I guess the previous programmer did things this way because it made things easy. Well, I'm the person that has to put up with the long-term headache. Anywho, someone at work wants things sped up, so what I'm looking at doing is this for each client:
110
10635
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst case scenario for MyISAM backend? Also is it possible to not to lose data but get them corrupted?
3
1638
by: tc | last post by:
I have an app that I'm re-writing for MySql and MsSql, the old version connected to an Access database. It is more than likely that existing customers will want to upgrade to the later version. I don't want to rely on 3rd party apps for Migration, so.... I'm more than happy to write the connection code and transfer the data myself, but I don't know how to ensure that all Auto Number fields in the Access database transfer correctly, as in...
3
3546
by: janetopps | last post by:
I have a news website, with asp pages, which was on Access, and i upgraded to MySQL, i used Bullzip to transfer the data. It had about 1000 pages, which im now able to pull up on the public side. Im sorting out a few glitches though. Since i upgraded from ms access database to MySQL, i have added about 4 articles to test the new setup. I note some fields aren't being added in the new mySql database for the new 4 records. When i ran the MySQK...
0
10538
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10305
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9115
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.