Yii Framework Forum: Table "table_Name" Does Not Exist In Model Generator Using Sql Server 2005 - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Table "table_Name" Does Not Exist In Model Generator Using Sql Server 2005 model generator error Rate Topic: ***** 1 Votes

#1 User is offline   redyopante 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 05-September 13

Posted 10 September 2013 - 08:52 PM

hi there...
i'm using PHP.5.2.5
Attached File  pdo.png (86.7K)
Number of downloads: 5

db sql server management studio express 2005 in different machine -> using windows server with ip 172.31.1.248
and my xampp installation use ip 172.31.1.45

when i migration,the output is running well...the table was auto create in db ebudget (tbl_invest)
Attached File  db.png (93.51K)
Number of downloads: 6

so i think, i successful to connect my yii with sqlserver 2005
this is the db code both config\console.php -> to migrate and config\main.php -> to generate gii
console.php
'db'=>array(
			'connectionString' => 'sqlsrv:server=172.31.1.248;database=ebudget',
			'username' => 'sa',
			'password' => 'xxx',
		),


main.php
'db'=>array(
			'connectionString' => 'sqlsrv:server=172.31.1.248;database=ebudget',
			'username' => 'sa',
			'password' => 'xxx',
		),

but when i want to generate model,the error looks like this
table tbl_invest does not exist
Attached File  model.png (80.06K)
Number of downloads: 5

so ,,,what should i do to correct this problem???
i hope anyone can help me,thank you :)

regards,
Redy
0

#2 User is offline   redyopante 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 05-September 13

Posted 15 September 2013 - 10:54 PM

hi......
is there any body can help my problem??
i hope some one can help me :unsure:
0

#3 User is offline   Ravi Madan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 22-February 13
  • Location:New Delhi

Posted 21 September 2013 - 03:46 PM

Hello redyopante,

Can you please check the below mention parameters in phpinfo(), if following parameters are set then your connection should work

1. Php Registered Stream should have sqlsrv
2. Under Apache Environment-> PATH -> its should have the environment variable or path of SQL Server 2005 installation
3. Under PDO Section -> POD driver should contain sqlsrv
4. pdo_sqlsrv should be enabled
5. sqlsrv support should be enabled


Also check if you have installed Sql Server 2005 Native Client, If not then you can download it from Microsoft website

Also Please find below the procedure to check whether SQLSRV is working fine or you have complete installation of sqlsrv DLL files or not

1. Check if the extension for MsSql exist in your "ext" folder of php installation, if not then kindly search for "Microsoft Drivers 3.0 for PHP for SQL Server" and download it from Microsoft website

2. Download SQLSRV30.EXE for PHP 5.3.6 or PHP 5.4.
OR
Download SQLSRV20.EXE for PHP < PHP 5.3.6.

and then load the DLL files after running this exe file into the "ext" folder of php installation by setting installing path popped up during installation.

3. After this, install Microsoft SQL Server 2005 Native Client available in the available on microsoft website after searching "SQL Server 2005 Feature Pack"

4. Restart the Microsoft SQL Server 2005

As this is my first post on YII, I am not able to share direct links so I'm sharing the keywords to search on google for Drivers and Native Clients of SQL Server

HOPE THIS WILL HELP YOU!!!


Thanks & Regards
Ravi Madan
0

#4 User is offline   redyopante 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 05-September 13

Posted 23 September 2013 - 08:59 PM

Thank you for your advise Ravi Madan,. :rolleyes:

Now i can connect my yii with sql server 2005, also can create model generator without error,.but i changed the location of db server,. from ip xxx.xx.x.xxx(different PC that is install windows server) into PC1111\SQLEXPRESS(localhost).

this is my step
1. copy file php_sqlsrv_52_ts_vc6.dll & php_pdo_sqlsrv_52_ts_vc6.dll into xampp\php\ext

2. add this script under file php.ini -> xampp\apache\php.ini
[PHP_SQLSRV]
extension=php_sqlsrv_52_ts_vc6.dll
[PHP_PDO_SQLSRV]
extension=php_pdo_sqlsrv_52_ts_vc6.dll


3. Download & install Microsoft SQL Server 2008 R2 Native Client, i choose x64 because i use 32 bit OS
sql server 2008 R2 native client

4. and this is my connection script both in protected\config\main.php and protected\config\console.php
'db'=>array(
			'connectionString' => 'sqlsrv:server=PC1111\SQLEXPRESS;database=ebudget',
			'username' => 'sa',
			'password' => 'P@ssw0rD',
		),



Regards,
Redyopante
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users