DSN, Storing variable permanently


Originally posted by : thunderain (lbrennan1@sympatico.ca)I have Windows 98. My two databases is set up in Control Panel, ODBC Data Sources, User DSNMy program will be using two databases. I am using a drop down menu for the user to pick which database to work with. Once the database is picked, they will be using it on all other pages. After selecting the database, I need to store the variable somewhere to access it on all other pages. I have used global.asa to store variables that are hardcoded in and that works find. Reading up on it, i don't see how to send a variable to global.asa to store it, or for that matter if you can.Can you send a varible to global.asa to be stored and used in other pagesIf yes, howShould I put it in an asp include, I am going in that direction Here is my code.------selectdatabase.asp-------- Database: GateKeeper GKAdmin ----Choose One------ ! ----------database-var.asp----------1/ It seens to be selecting the database ok. There are no errers, but I am not getting anything from Response.write username2/ When the database is selected, how do i store it permanently while the user goes to other pages and call it from other pagesThank you, Larry
Posted On: Tuesday 20th of November 2012 12:42:15 AM Total Views:  74
View Complete with Replies

RELATED TOPICS OF MYSQL PROGRAMMING LANGUAGE




regarding creating dsn user automatically

Create the file having ".reg" extension with below content (change appropriate paramters as per your requirement and setting), save it and double click on it. It automatically creates all the parameter for MYSQL System DSN. ---------- Content Start ------------- Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\MYSQLSchema] "Driver"="C:\\Program Files\\MySQL\\Connector ODBC 5.1\\myodbc5.dll" "SERVER"="localhost" "UID"="root" "PWD"="xxxx" "DATABASE"="information_schema" "OPTION"="3147784" "PORT"="3306" ---------- Content End ------------- Hope this will solve your problem.
VIEWS ON THIS POST

241

Posted on:

Friday 5th October 2012
View Replies!

creating dsn in linux

\t I am new user for operating the linux..how to create a dsn(data source name) for mysql in linux..please anyone help me for this problem.......
VIEWS ON THIS POST

128

Posted on:

Friday 5th October 2012
View Replies!

How can i create dsn on linux machine

hello, i am raghvendra. i am working on linux. i am using a php4 with apache 2 on linux machine. i want to create a dsn on linux machine. but i donot know how can i do this. my database is on remote windows machine. could any body help me thanx & regards raghvendra khandal
VIEWS ON THIS POST

130

Posted on:

Friday 12th October 2012
View Replies!

Question - Manual edit of database backup prior to restoring

I am not too experienced with MYSQL so the answer maybe obvious but it's causing me to pull my hair out. I may also have answered my own question but I would like confirmation that doing what seems logical is OK and that there are no hidden problems being created. A website I manage needed sorting out so I backed up the MYSQL DB and downloaded the complete site to my HD. I then deleted everything and created a new DB, same name etc etc. When I try to restore the DB it fails because a DB of that name already exists. There doesn't seem to be a way to restore a DB from the back up if the DB doesn't already exist, or if it does it is not obvious to me. looking at the first few lines of the back up I see the following... CREATE DATABASE `DB4ME` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `DB4ME`; It seems logical that if I delete the line CREATE DATABASE `DB4ME` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; That the first instruction is then USE `DB4ME`; My question is therefore is that correct or is there more to it\t This is the first section of the back data... -- phpMyAdmin SQL Dump -- version 2.8.2.4 -- PHP URL -- -- Host: localhost:3306 -- Generation Time: May 28, 2008 at 09:21 AM -- Server version: 4.1.20 -- PHP Version: 5.0.5 -- -- Database: `DB4ME` -- CREATE DATABASE `DB4ME` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `DB4ME`; -- -------------------------------------------------------- If anyone could clarify my logic or otherwise offer me way round this I'd be most grateful.
VIEWS ON THIS POST

278

Posted on:

Friday 12th October 2012
View Replies!

A decent utility for backing up and restoring large mysql databases?

I have tried multiple utilities to backup and restore mysql databases... I say large in my header but they are not really. They are just to big to restore with phpMyAdmin. I can't tell you how frustrating it always is when I try to do this... there will always be some kind of error when I try to do it. I have tried various utilties and nothing seems to do the job properly. You know those days when everything you try fails Yes I know I can break them up but surely there must be something that can do this for me on the fly reliably
VIEWS ON THIS POST

168

Posted on:

Friday 12th October 2012
View Replies!

SQL date storing

Question : I need to store date only in 'dd.mm.' format, in my case i don't need year. For example i want to have table seasons defined : Code: season_code from to firstq 02.04. 01.06. secq 02.06. 28.08. thirq 29.08. 01.10. So i can handle this from and to fields as date.
VIEWS ON THIS POST

121

Posted on:

Sunday 21st October 2012
View Replies!

Problem Backing Up and Restoring Databases with pgAdmin 3 (1.10.0)

I'm having an issue with backing up and restoring databases with pgAdmin 3 (1.10.0). The problem is with how pgAdmin is converting every "serial" type column to it's "int" equivalent. For example the following table: Code: CREATE TABLE users_ranks ( id serial NOT NULL, rank character varying(10) NOT NULL, CONSTRAINT users_ranks_pkey PRIMARY KEY (id) ) Is converted to this after the dumb/restore: Code: CREATE TABLE users_ranks ( id integer NOT NULL DEFAULT nextval(('public.users_ranks_id_seq'::text)::regclass), rank character varying(10) NOT NULL, CONSTRAINT users_ranks_pkey PRIMARY KEY (id) ) In the past I've been backing up the databases as SQL files, editing the backup SQL to blow away the the DEFAULT crap and change the columns back to their orignal "serial" type. This is, of course, a giant pain in my ***. Is there something I'm doing wrong or is this a bug
VIEWS ON THIS POST

84

Posted on:

Sunday 21st October 2012
View Replies!

What is the data type for storing long text with HTML tags in pgsql?

, What is the data type for storing long text with HTML tags in pgsql I need to store the HTML formated template like texts in the database. Thank you in advance. With
VIEWS ON THIS POST

117

Posted on:

Sunday 21st October 2012
View Replies!

Most efficient way of storing data from multiple accounts

As part of a system I am putting together I need to allow users to create thier own accounts on my servers. Each user can create their own account, and then have their users register for it. Each account needs it data seperate from the others, a member registered for one account should not be able to view another account and a username registered with one account should still be available to the other accounts. The ways I have been looking at are: 1. Create a new database for every account created so that all users are kept in seperate databases. 2. Have one table for users, one for topics, one for posts etc and then associate each row within this table with the relevent account. So for example a user could register with the forum with the ID 4, so their user entry would be Userid: 234 Username: xxxx Password: xxxx Forumid: 4 Then when a new member registers with any account I simply check that there is not another user with the same account ID and username. Indexes on relevent fields in this system could help speed up huge tables. I expect to quickly have 20,000 plus accounts (and in theory it could go up to hundreds of thousands). I guess my question is which of these methods is better from a speed point of view once we get a large number of accounts and users. Also, are there restrictions on the number of fields in a table that could cause problems Using MySQL by the way, on an Apache server.
VIEWS ON THIS POST

114

Posted on:

Sunday 21st October 2012
View Replies!

Error when restoring a database

, I backed up a table about a month ago and now I am trying to restore it. For some reasons, I got this error while restoring this table. ERROR 1064 at line 6945692: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''http://us.f422.mail.yahoo.com/ym/ShowFolderrb=Inbox&reset=1& My mysql version is version: 4.0.20a-nt Can some please tells me what is wrong here so I can correct it and restore the complete table
VIEWS ON THIS POST

244

Posted on:

Wednesday 24th October 2012
View Replies!

Requesting help on storing user generated content

I'm wondering if there's any info out there on storing user generated and customized content. For example, if it was a single web page, and the user set some of the css, some of the html, and a bunch of content. Initially, it sounds like a many to many tables situation, but honestly, it's overwhelming me having cels for each css property, etc. But then, storing the whole lot in one table or even one row makes it a nightmare for updating. Also, in situations like this are new tables generated for users Hopefully there's some inspirational info out there
VIEWS ON THIS POST

118

Posted on:

Thursday 25th October 2012
View Replies!

Using magic numbers or storing redundant data?

Say I have a couple of columns in a database table, named BizType and AccountType. To satisfy business rules, BizType needs to be either a "Parent" business or a "Sub" business. Second, AccountType needs to be either "Business", "Personal" or "Both". BizType My first inclination was to make 1 represent "Parent" and 2 represent "Sub", and then store a series of 1s and 2s in the data column. However, after I looked how the database table looked using these "magic numbers", I was afraid it would cause another developer a bit of a headache in trying to determine what these numbers represented, even though I did put the representation in the table comments. So I changed all the 1s to Parent and the 2s to Sub and put a constraint on the table so that BizType must equal Parent or Sub. However, I still wasn't happy with how the table worked, mainly as a result of storing redundant data. I'm having trouble though justifying creating a second table that stored Parent and Sub with IDs of 1 and 2 and storing those IDs as foreign keys in my original table as these aren't likely to ever change. Also, although another developer is more likely to realize these are foreign keys and find the related table, I dont see this situation as significantly more beneficial than using magic numbers, as these values are unlikely to change. Account Type I had the same problem with this column. I was going to assign 1 to Business, 2 to Personal and 3 to Both. I didn't like using magic numbers so I decided to just stored Business, Personal and Both. But now I don't like storing redundant data, but cannot justify creating a second table to store the three values, as they are not likely to change because of business rules. Also, the future developers might still look at the table and say "What do these numbers stand for" I don't see creating a second table storing the three values as being much more beneficial than using magic numbers. If anyone has ever come across a similar situation and could give me some direction/advice on what might be an appropriate way of solving this problem that would be spectacular. I know the cardinal rule of databases is to not store redundant data, but I wonder if this might be one of those exceptions, as magic numbers are frowned upon as well, although more so in programming. Thank you all for you time! Travis Rhynard
VIEWS ON THIS POST

162

Posted on:

Thursday 25th October 2012
View Replies!

Tracking changes like a wiki (not storing redundant data)

Here's an interesting database problem that I thought some of you might know how to solve... If you do, I'd appreciate the help! I'm trying to set a system up where people can edit pages so that what they see is always the most recent version of a piece of text, but actually the database stores all previous versions as well, so that one can retrieve a copy of the text after each individual edit is submitted. Kind of like Wikipedia, although I don't need the ability to actually roll things back and forward, I just need the changes to be identifiable. Now, obviously I could do this by just storing a new row everytime the text is edited. But this could take up a lot more space than I'd like. Can anybody think of a way of storing only the changes, and not the data that stays constant between two edits PS: I mean besides relying on the binary logs .
VIEWS ON THIS POST

395

Posted on:

Monday 29th October 2012
View Replies!

Opinions: storing images in DB?

I have read some opinions stating that it is better to store images on the file system rather than the DB. And only note the image name in the DB/table for a reference. I was wondering of some experienced members could tell me if that is a better way of doing things or storing them in the DB is just fine Note: This is not for an enterprise level website. It is for a very small one.
VIEWS ON THIS POST

107

Posted on:

Monday 29th October 2012
View Replies!

How do i import from system dsn

On windows server 2003 my System DSN name is TLC. the connection string is "Provider=MSDASQL.1;Persist Security Info=False;Data Source=TLC" i'd like to import all timestamp fields as varchar if possible because ther are unexpected values in these fields. The source database is third party and i am forced to use their odbc connector. I tred using Navicat but i can only import 20/s of 1,000,000. Thiis makes the import not pratical. SQL on the same server import 2000/s. I believe the MYISAM engine is the best since it just a straight import.
VIEWS ON THIS POST

156

Posted on:

Monday 29th October 2012
View Replies!

help with storing and retriving dates

hey, i'm currently working on a small php program to store details of petrol receipts. The part i'm stuck on is which field type to use to store the date. And then how to order the dates. i need to order by year then month and then day. I have no idea how to sort dates and need to be able to add receipts in any order. any help advice would be greatly appreciated. *edit* the date i want to store is in the format DD.MM.YYYY the date is created via pull down menu's
VIEWS ON THIS POST

99

Posted on:

Monday 29th October 2012
View Replies!

Restoring part of a backup

Hi , I've got a backup of all the databases on my server, which includes databases from a number of different users. How do I restore the backup for only one specific user (ie only restore his databases from the backup file)
VIEWS ON THIS POST

123

Posted on:

Monday 29th October 2012
View Replies!

Restoring a Saved Database

Hi , I recently saved my database using MySQL's export function - I exported it as localhost.sql through the system. I would like to restore this database. It is about 20mb in size. How do I achieve this
VIEWS ON THIS POST

94

Posted on:

Monday 29th October 2012
View Replies!

Restoring from mysqldumped file has bad characters

So, I'm trying to restore a giant file that was created using mysqldump with mysql v4.1. This giant file is gzipped to 66GB, so the command I use is: gunzip < big_sql_file.gz | mysql -u user Doing this I get the following error after a while: ERROR 1136 (21S01) at line 77475: Column count doesn't match value count at row 1838 Okay, fine...irritating, but okay. Add a -f and it fixes it for a while. After a while, it gets totally wacked. There must be some real funky characters, because the logs show the following... ERROR 1064 (42000) at line 571024: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cell phone',NULL,NULL,50.00,0.00,50.00,0.00,50.00,50.00,1,1,'2006-08-04 11:27:53' at line 1 ERROR at line 915146: Unknown command '\''. Vim: Warning: Output is not to a terminal Vim: Warning: Input is not from a terminal etc. etc. etc.... Okay, here is my question. There are obviously bad characters in the dump file. I'm surprised that this would even be possible using mysqldump. Kind of pointless to really use it if that's the case. Anyway, is there any way to get around this I'm already using -f, not working. Am I forced to just tar-gzip the mysql folders The total db is about 250GB... I really, really appreciate any help anyone could give...
VIEWS ON THIS POST

151

Posted on:

Monday 29th October 2012
View Replies!

Need help restoring .sql file

I just installed MySQL 5.x, and it's been a while since I've used an earlier version of the program. I have phpMyAdmin, but I'm still trying to figure out the syntax for the config.inc.php file, so I can't use that program for a while. My earlier version of MySQL let me restore a backup like this: C:\mysql\bin> mysql -p forums
VIEWS ON THIS POST

183

Posted on:

Monday 29th October 2012
View Replies!